Class

IPicture


Description

IPicture is the primary interface implemented by the OLE-provided picture object. It allows the caller to manage picture properties and to use that picture in graphical rendering.

Properties

Name

Type

Read-Only

Shared

Handle

Ptr

Methods

Name

Parameters

Returns

Shared

AddRef

UInt32

Constructor

p As Ptr

QueryInterface

riid As Ptr, ByRef out As Ptr

Integer

Release

UInt32

Property descriptions


IPicture.Handle

Handle As Ptr

Returns the raw IUnknown pointer.

Method descriptions


IPicture.AddRef

AddRef As UInt32

Increments a reference count and returns the value of the reference count.


IPicture.Constructor

Constructor(p As Ptr)

Note

Constructors are special methods called when you create an object with the New keyword and pass in the parameters above.

Creates a new IUnknown class from the supplied pointer. The constructor does not automatically add a reference count, but when the destructor is called a reference is released.


IPicture.QueryInterface

QueryInterface(riid As Ptr, ByRef out As Ptr) As Integer

Retrieves the address of a specified interface.

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

IPicture.Release

Release As UInt32

Decrements a reference count and returns the value of the reference count.

Compatibility

All project types on all supported operating systems.

See also

IUnknown parent class; COM module; IDispatch, IEnumVARIANT, IUnknown.