1. register the C ++ function.
// Register the callback function macro // you can register two function prototypes based on your needs. Note that the functions registered in connect_js_call_simple_handler must be properly coordinated with HTML calls in advance. The parameters must all be characters, the owner will cause unknown problems # define connect_js_call_handler (name, func, pcontext) Do \ {\ If (! Cbkcallbackfunccontainer: getfuncptr ()-> nameid (L # Name) \ cbkcallbackfunccontainer: getfuncptr ()-> connectjsfunchandler (L # name, (jscallbackfunction) & func, false, pcontext) ;\} while (false); connect_js_call_handler (opencustomstockdlg, (jscallbackfunction) & opencustomstockdlg, this );
2. Called function declaration.
static int OpenCustomStockDlg(DISPPARAMS* params, VARIANT* retval , void* pContext);
3. Implementation of the called function.
int CXXWindow::OpenCustomStockDlg(DISPPARAMS* params, VARIANT* retval , void* pContext){ CFinancialMainWindow* _pThis = static_cast<CFinancialMainWindow*>(pContext); ATLASSERT(_pThis); CString strCur = "0"; if (params->cArgs == 1) { strCur = params->rgvarg[0]; } //_pThis->OpenLogingSetDlg(StrToLong(strCur)); CString strPara = _pThis->Get_SignPara(); CustomStockSynchronous dlgCustomStock(strPara); dlgCustomStock.DoModal(); return 0;}
4.html
<HTML>
Original article: http://www.cnblogs.com/chunyou128/archive/2011/10/26/2225846.html