query interface in VB??.....
-
Guyz, I remember working with C++ COM, I could use QueryInterface to find whether an interface is supported in a component. Is there a similar mechanism in VB too? If not what would be a best way to do. :eek:Thnx!
-
Guyz, I remember working with C++ COM, I could use QueryInterface to find whether an interface is supported in a component. Is there a similar mechanism in VB too? If not what would be a best way to do. :eek:Thnx!
You could use the "IF TYPEOF objectname IS objecttype" statement in VB.NET to determine if a component supports a given interface.
-
You could use the "IF TYPEOF objectname IS objecttype" statement in VB.NET to determine if a component supports a given interface.
A better method (object orientated etc.) would be to use IsInstanceOf e.g. to find out if
MyObject
implements the interfaceIMyInterface
use the following code.GetType(IMyInterface).IsInstanceOfType(MyObject)