Udostępnij za pośrednictwem


COleDispatchDriver::operator LPDISPATCH

Accesses the underlying IDispatch pointer of the COleDispatchDriver object.

operator LPDISPATCH( );

Example

COleDispatchDriver disp;
if (disp.CreateDispatch(_T("WMPlayer.OCX")))
{
   IDispatch* pDispatch = disp; //COleDispatchDriver::operator
                                //LPDISPATCH is called here
   IUnknown* pUnkn = NULL;
   HRESULT hr = pDispatch->QueryInterface(IID_IUnknown ,(void**)&pUnkn);
   if (SUCCEEDED(hr))
   {
      //Do something...
      pUnkn->Release();
   }
}

Requirements

Header: afxdisp.h

See Also

Reference

COleDispatchDriver Class

Hierarchy Chart

COleDispatchDriver::m_lpDispatch

Other Resources

COleDispatchDriver Members