Providing Information on the Run-Time Object

The GetRuntimeClassID and GetRuntimeMiscStatusFlags methods return information about the run-time object. Although the information is stored in the system registry, hosts can query the ActiveX Designer more efficiently than they can query the registry.

The host application calls the GetRuntimeClassID method to get the CLSID when it builds the executable application. In the following example, the ActiveX Designer returns the CLSID from a global constant:

STDMETHODIMP CMyDesigner::GetRuntimeClassID
(
    CLSID *pclsid
)
{
    CHECK_POINTER(pclsid);

    *pclsid = CLSID_RuntimeInstance;
    return S_OK;
}
 

The GetRuntimeMiscStatusFlags method returns status flags that are defined for all ActiveX objects. In the following example, the flag values are stored in the constant RUNTIME_MISCSTATUS. The method simply returns the value of the constant to the caller:

STDMETHODIMP CMyDesigner::GetRuntimeMiscStatusFlags
(
    DWORD *pdwMiscStatus
)
{
    CHECK_POINTER(pdwMiscStatus);

    *pdwMiscStatus = RUNTIME_MISCSTATUS;
    return S_OK;
}
 

For information about the flags, refer to the  COM Programmer's Reference.