@ ^ @:如果是加载到web控件上,就把注释掉的解除注释(改为web控件点后面的函数),把下一句注释
1 BOOL Button::LoadFromResource(UINT nRes){ //打开网页加载自己写的html文件 2 3 HINSTANCE hInstance = AfxGetResourceHandle(); 4 ASSERT(hInstance != NULL);//确定有资源 5 6 CString strResourceURL; 7 BOOL bRetVal = TRUE; 8 LPTSTR lpszModule = new TCHAR[_MAX_PATH]; 9 10 if (GetModuleFileName(hInstance, lpszModule, _MAX_PATH)){11 strResourceURL.Format(_T("res://%s/%d"),lpszModule, nRes);12 //Navigate(strResourceURL, 0, 0, 0);13 ShellExecute(NULL,_T("open"),strResourceURL,NULL,NULL,SW_SHOWNORMAL);14 }15 else bRetVal = FALSE;16 17 delete [] lpszModule;18 return bRetVal;19 }