记录js访问vc

class CCustomControlSite:public COleControlSite

class CCustomOccManager :public COccManager

STDMETHODIMP CCustomControlSite::XDocHostUIHandler::GetExternal(
            /* [out] */ IDispatch __RPC_FAR *__RPC_FAR *ppDispatch)
{
 // return the IDispatch we have for extending the object Model
 METHOD_PROLOGUE(CCustomControlSite, DocHostUIHandler)
 //return E_NOTIMPL;
 *ppDispatch = ((CimmailDlg *)AfxGetMainWnd())->m_external.GetIDispatch(TRUE);
 //*ppDispatch = ((CimmailApp *)AfxGetApp())->m_external.GetIDispatch(TRUE);
 return S_OK;
}

BEGIN_DISPATCH_MAP(CExternal, CCmdTarget)
 //{{AFX_DISPATCH_MAP(CExternal)
 DISP_FUNCTION(CExternal, "WobbleWnd", WobbleWnd, VT_EMPTY, VTS_NONE)
 //}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()

CCustomOccManager *pMgr = new CCustomOccManager;

AfxEnableControlContainer(pMgr);

你可能感兴趣的:(记录js访问vc)