IUnknown

From Xojo Documentation
Jump to: navigation, search

Class (inherits from Object)

IUnknown is the common interface supported by all COM objects.

Properties
Handle


Methods
AddRef Release
QueryInterface


Constructors

IUnknown.Constructor(p As Ptr)


Examples

The following automates Internet Explorer and queries for a specific interface (each interface is identified by a unique IID)

Dim ie As New OLEObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate("google.com")

Dim unk As New COM.IUnknown(ie.Handle)

// Query for the IID_IWebBrowser2 interface
Dim iid As MemoryBlock = COM.IIDFromString("{D30C1661-CDAF-11D0-8A3E-00C04FC9E26E}")
Dim out As Ptr
If 0 = unk.QueryInterface(iid, out) Then
// Yay this interface exists
Break
End If

See Also

COM module; IDispatch, IEnumVARIANT, IPicture.

Personal tools
Namespaces

Variants
Actions
Main
Content
Starting Out
Dig Deeper
More Help
Toolbox
About