Home COM GDI+ WebBrowser Data Access

ISpecifyPropertyPages Interface

 

IID_ISpecifyPropertyPages

{B196B28B-BAB4-101A-B69C-00AA00341D07}

 

 

The ISpecifyPropertyPages interface is a standard Win32 OLE interface. You implement this interface to allow the pipeline administration tool to invoke the property page user interface of the component.

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

ISpecifyPropertyPages Method

Description

GetPages

This method fills a counted array of universally unique identifier (UUID) values where each UUID specifies the class identifier (CLSID) of a particular property page that can be displayed in the property sheet for this object.

 

The CAUUID structure is caller-allocated, but is not initialized by the caller. The ISpecifyPropertyPages::GetPages method fills the cElements field in the CAUUID structure. This method also allocates memory for the array pointed to by the pElems field in the CAUUID structure using the CoTaskMemAlloc method. Then, it fills the newly allocated array. After this method returns successfully, the structure contains a counted array of UUIDs, each UUID specifying a property page CLSID.

 

The returned array must be freed with a call to CoTaskMemFree.

 

CAUUID Structure

 

TYPE CAUUID
   cElems AS DWORD
   pElems AS GUID PTR
END TYPE

 

 

GetPages

 

FUNCTION ISpecifyPropertyPages_GetPages ( _

  BYVAL pthis AS DWORD PTR _

, BYREF pPages AS CAUUID _

  ) AS LONG

  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[3] USING ISpecifyPropertyPages_GetPages (pthis, pPages) TO HRESULT
  FUNCTION = HRESULT

END FUNCTION

 

 

How to show the property pages of an ActiveX control

 

FUNCTION TB_DoVerbProperties ( _

  BYVAL hParent AS DWORD, _

  BYVAL strCaption AS STRING, _

  BYVAL lpObj AS DWORD _

  ) AS LONG

  LOCAL hr AS LONG
  LOCAL tPages AS CAUUID
  LOCAL IID_ISpecifyPropertyPages AS GUID
  LOCAL lpPages AS DWORD

  IID_ISpecifyPropertyPages = GUID$("{b196b28b-bab4-101a-b69c-00aa00341d07}")

  hr = IUnknown_QueryInterface(lpObj, IID_ISpecifyPropertyPages, lpPages)
  IF hr THEN
     FUNCTION = hr
     EXIT FUNCTION
  END IF

  hr = ISpecifyPropertyPages_GetPages(lpPages, tPages)
  IUnknown_Release lpPages
  IF hr THEN
     FUNCTION = hr
     EXIT FUNCTION
  END IF

  ' tPages.pElems returns a pointer to an array of ClsIDs.
  ' To get them use:
  ' LOCAL i AS LONG
  ' FOR i = 0 TO tPages.cElems - 1
  '    MSGBOX GUIDTXT$(tPages.@pElems[i])
  '  NEXT

 

  ' Show the pages - Note that we are passing the address

  ' of lpObj since this parameter is an array of objects,

  ' although we are passing only one object.
  ' If we were going to pass an array we will need to use

  ' VARPTR(lpObjArray(0)).
 

  strCaption = UCODE$(strCaption)
  hr = OleCreatePropertyFrame (hWndMain, 0, 0, _

       STRPTR(strCaption), 1, VARPTR(lpObj), _

       tPages.cElems, tPages.pElems, 0, 0, 0)
  FUNCTION = hr

  ' Release the pages array
  IF tPages.pElems THEN CoTaskMemFree tPages.pElems

END FUNCTION
 

 

Page last updated on Monday, 03 April 2006 20:27:50 +0200