Home COM GDI+ WebBrowser Data Access

IClassFactory Interface

 

IID_IClassFactory

{00000001-0000-0000-C000-000000000046}

 

 

The IClassFactory interface contains two methods intended to deal with an entire class of objects, and so is implemented on the class object for a specific class of objects (identified by a CLSID). The first method, CreateInstance, creates an uninitialized object of a specified CLSID, and the second, LockServer, locks the object's server in memory, allowing new objects to be created more quickly.

 

 

Methods in VTable order

IUnknown Methods

Description

QueryInterface

Returns pointers to supported interfaces.

AddRef

Increments reference count.

Release

Decrements reference count.

IClassFactory Methods

Description

CreateInstance

Creates an uninitialized object.

LockServer

Locks object application open in memory.

 

CreateInstance

 

FUNCTION IClassFactory_CreateInstance ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pUnkOuter AS DWORD _

, BYREF riid AS GUID _

, BYREF ppvObject AS DWORD _

  ) AS LONG


  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[3] USING IClassFactory_CreateInstance (pthis, pUnkOuter, riid, ppvObject) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

 

FUNCTION IClassFactory_CreateInstance ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL pUnkOuter AS DWORD _

, BYREF riid AS GUID _

, BYREF ppvObject AS DWORD _

  ) AS LONG


  ! push ppvObject
  ! mov  eax, riid
  ! push eax
  ! push pUnkOuter
  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax+12]
  ! mov  FUNCTION, eax


END FUNCTION

 

 

LockServer

 

FUNCTION IClassFactory_LockServer ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL fLock AS LONG _

  ) AS LONG


  LOCAL HRESULT AS LONG
  CALL DWORD @@pthis[4] USING IClassFactory_LockServer (pthis, fLock) TO HRESULT
  FUNCTION = HRESULT


END FUNCTION

 

 

 

FUNCTION IClassFactory_LockServer ( _

  BYVAL pthis AS DWORD PTR _

, BYVAL fLock AS LONG _

  ) AS LONG


  ! push fLock
  ! mov  eax, pthis
  ! push eax
  ! mov  eax, dword ptr[eax]
  ! call dword ptr[eax+16]
  ! mov  FUNCTION, eax


END FUNCTION

 

 

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