IUnknown
From Xojo Documentation
Class (inherits from Object)
This class is only available on the Windows platform. For cross-platform compatibility, use #If...#Endif with the Target... specifiers to make sure you will not attempt to use this class on an incompatible platform. |
IUnknown is the common interface supported by all COM objects.
Properties | |
|
Methods | |||
|
Constructors | |
|
Examples
The following automates Internet Explorer and queries for a specific interface (each interface is identified by a unique IID)
Var ie As New OLEObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate("google.com")
Var unk As New COM.IUnknown(ie.Handle)
// Query for the IID_IWebBrowser2 interface
Var iid As MemoryBlock = COM.IIDFromString("{D30C1661-CDAF-11D0-8A3E-00C04FC9E26E}")
Var out As Ptr
If 0 = unk.QueryInterface(iid, out) Then
// Yay this interface exists
Break
End If
ie.Visible = True
ie.Navigate("google.com")
Var unk As New COM.IUnknown(ie.Handle)
// Query for the IID_IWebBrowser2 interface
Var iid As MemoryBlock = COM.IIDFromString("{D30C1661-CDAF-11D0-8A3E-00C04FC9E26E}")
Var out As Ptr
If 0 = unk.QueryInterface(iid, out) Then
// Yay this interface exists
Break
End If
See Also
COM module; IDispatch, IEnumVARIANT, IPicture.