This topic has not yet been rated - Rate this topic

CCmdTarget::GetIDispatch

Call this member function to retrieve the IDispatch pointer from an automation method that either returns an IDispatch pointer or takes an IDispatch pointer by reference.

LPDISPATCH GetIDispatch(
   BOOL bAddRef 
);

Parameters

bAddRef
Specifies whether to increment the reference count for the object.

Return Value

The IDispatch pointer associated with the object.

Remarks

For objects that call EnableAutomation in their constructors, making them automation enabled, this function returns a pointer to the Foundation Class implementation of IDispatch that is used by clients who communicate via the IDispatch interface. Calling this function automatically adds a reference to the pointer, so it is not necessary to make a call to IUnknown::AddRef.

See Also

CCmdTarget Overview | Class Members | Hierarchy Chart | CCmdTarget::EnableAutomation | COleDispatchDriver | IUnknown::Release

Did you find this helpful?
(1500 characters remaining)