js如何调用C++程序(程序有点大,有库)
就是想使用js在阿里云中调用c++程序,前端是html+css+js,后端是c++。c++代码可以在vs上正常运行,就想问问如何让js调用c++?
程序代码:
void CAddGoogleMap_CHtmlView::OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTargetFrameName, CByteArray& baPostedData, LPCTSTR lpszHeaders, BOOL* pbCancel) { // TODO: Add your specialized code here and/or call the base class CString strUrl = lpszURL; if(strUrl.Left(4) == _T("app:")) { // cancel the common url navigate and call your c++ code here *pbCancel = TRUE; MessageBox("调用了C++函数", "来自对话框消息"); // call other c++ function here or parse the argument in the strUrl } CHtmlView::OnBeforeNavigate2(lpszURL, nFlags, lpszTargetFrameName, baPostedData, lpszHeaders, pbCancel); }