tryCast<T extends IUnknown> method
Tries to cast this COM object to an interface specified in iid
.
creator
must be the constructor of the class to be casted to (e.g.,
ICalendar.fromPtr
).
Returns null
if the cast fails.
Implementation
T? tryCast<T extends IUnknown>(
T Function(Pointer<COMObject>) creator, String iid) {
try {
return cast(creator, iid);
} on WindowsException {
return null;
}
}