ArticleDirectory
Zhou daibing
---- After installing IE 4, you can use the format of the text box to display the HTML file in the Process Order, such as pop-up text AIDS written in HTML, etc. For example, the browser is connected directly, but it is different from the browser style.
---- Its implementation is as follows:
// In the header file or. the beginning of the CPP file contains the file urlmon. h, define the function // # include "urlmon. H "typedef hresult stdapicalltype showhtmldialogfn (hwnd hwndparent, imoniker * PMK, variant * pvarargin, tchar * pchoptions, variant * pvargout); // The function display dialog box, true is returned successfully. falsebool showhtml () {hinstance hinstmshtml = loadlibrary (text ("mshtml. DLL "); // load the dynamic Connection Library wchar URL [] = l" http: // www.ccw.com.cn "; // This address name can be directly replaced by an HTML file name if (hinstmshtml) // dynamic connection library loaded {s * Pfnshowhtmldialog; pfnshowhtmldialog = (showhtmldialogfn *) getprocaddress (hinstmshtml, text ("showhtmldialog"); If (pfnshowhtmldialog) {imoniker * moniker = NULL; // If (failed (createurlmoniker (null, (lpwstr) URL, & moniker) {freelibrary (hinstmshtml); Return false ;} // call the showhtmldialog function to display the HTML file pfnshowhtmldialog (m_hwnd, moniker, null) on the URL. If (moniker! = NULL) moniker-> release (); // If the display is successful, true return true;} else // getprocessaddress fails to return false; freelibrary (hinstmshtml );} else // failed to load dynamic Connection Library return false ;}