|
|
|
IClassFactory2 Interface |
|
IID_IClassFactory2 |
{B196B28F-BAB4-101A-B69C-00AA00341D07} |
|
The IClassFactory2 interface enables a class factory object, in any sort of object server, to control object creation through licensing. This interface is an extension to IClassFactory. This extension enables a class factory executing on a licensed machine to provide a license key that can be used later to create an object instance on an unlicensed machine. Such considerations are important for objects like controls that are used to build applications on a licensed machine. Subsequently, the application built must be able to run on an unlicensed machine. The license key gives only that one client application the right to instantiate objects through IClassFactory2 when a full machine license does not exist.
|
|
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. |
|
IClassFactory2 Methods |
Description |
|
GetLicInfo |
Fills a LICINFO structure with information on the licensing capabilities of this class factory. |
|
RequestLicKey |
Creates and returns a license key that the caller can save and use later in calls to CreateInstanceLic. |
|
CreateInstanceLic |
Creates an instance of the licensed object given a license key from RequestLicKey. |
|
LICINFO Structure |
|
The LICINFO structure contains parameters that describe the licensing behavior of a class factory that supports licensing. The structure is filled during the GetLicInfo method.
TYPE LICINFO fLicVerified AS LONG END TYPE
|
|
GetLicInfo |
|
FUNCTION IClassFactory2_GetLicInfo ( _ BYVAL pthis AS DWORD PTR _ , BYREF pLicInfo AS LICINFO _
) AS LONG
|
|
FUNCTION IClassFactory2_GetLicInfo ( _ BYVAL pthis AS DWORD PTR _ , BYREF pLicInfo AS LICINFO _
) AS LONG
|
|
RequestLicKey |
|
FUNCTION IClassFactory2_RequestLicKey ( _ BYVAL pthis AS DWORD PTR _ , BYVAL dwReserved AS DWORD _ , BYREF strKey AS STRING _
)
AS LONG strKey =
ACODE$(strKey)
|
|
FUNCTION IClassFactory2_RequestLicKey ( _ BYVAL pthis AS DWORD PTR _ , BYVAL dwReserved AS DWORD _ , BYREF strKey AS STRING _
)
AS LONG LOCAL pbstrKey AS DWORD strKey = UCODE$(strKey) pbstrKey = STRPTR(strKey)
|
|
CreateInstanceLic |
|
FUNCTION IClassFactory2_CreateInstanceLic ( _ BYVAL pthis AS DWORD PTR _ , BYVAL pUnkOuter AS DWORD _ , BYVAL pUnkReserved AS DWORD _ , BYREF riid AS GUID _ , BYVAL strKey AS STRING _ , BYREF ppvObj AS DWORD _
)
AS LONG LOCAL HRESULT AS LONG strKey = UCODE$(strKey) END FUNCTION
|
|
FUNCTION IClassFactory2_CreateInstanceLic ( _ BYVAL pthis AS DWORD PTR _ , BYVAL pUnkOuter AS DWORD _ , BYVAL pUnkReserved AS DWORD _ , BYREF riid AS GUID _ , BYVAL strKey AS STRING _ , BYREF ppvObj AS DWORD _
)
AS LONG LOCAL pbstrKey AS DWORD strKey = UCODE$(strKey) pbstrKey = STRPTR(strKey)
END FUNCTION
|
|
How to retrieve the license key |
|
FUNCTION
TB_GetRuntimeLicenseKey (BYVAL ProgramID
AS STRING) AS STRING |
Page last updated on Thursday, 16 March 2006 22:40:24 +0100