IActiveDesigner::GetExtensibilityObject

Returns the extensibility object for the ActiveX designer.

HRESULT GetExtensibilityObject(
   IDispatch **ppvObjOut
);

Parameter

ppvObjOut

[out] Pointer to an IDispatch interface.

Return Values

The designer returns one of the following values.

Return Value Meaning
S_OK The method succeeded.
E_FAIL The method failed for an unknown reason.
E_NOTIMPL The run-time and design-time objects are the same, or the designer does not support programmatic manipulation.
E_OUTOFMEMORY Not enough memory is available to complete the operation.
E_POINTER The ppvObjOut parameter is not a valid pointer.

Comments

The designer implements this method.

If the ActiveX designer can be programmatically manipulated, its IDispatch interface is available in one of two ways. If the visual designer implements IActiveDesigner, the IDispatch interface is available through GetExtensibilityObject. If the visual designer does not implement IActiveDesigner, objects must call QueryInterface to get the IDispatch interface.

In Visual Basic version 5.0 and later, the extensibility object for the visual designer is available to add-ins (servers that extend the integrated development environment, or IDE) through the extensibility object of the IDE.

You may support this method without implementing the other methods of the interface.

Example

The following example creates a new extensibility object and returns its address to the caller:

STDMETHODIMP CMyDesigner::GetExtensibilityObject
(
  IDispatch **ppExtensibilityObject
)
{
  if (!ppExtensibilityObject) return E_POINTER;

  *ppExtensibilityObject = new CMyAddInTopLevelAutomationObject;
  return (*ppExtensibilityObject) ? S_OK : E_OUTOFMEMORY;
}