Providing Information about the Run-Time Object

The GetRuntimeClassID and GetRuntimeMiscStatusFlags methods return information about the run-time object. Although this information is stored in the system registry, supporting these methods may enhance performance because hosts can query the ActiveX designer more efficiently than they can query the registry.

The host 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. The flags are stored in the registry as the OLE miscellaneous status flags. In the following example, the application keeps a copy of the flags 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, see the COM Programmer's Reference in the Platform Software Development Kit (SDK).