Generally, we do programs, such as using VC, and developing the interface is a headache. The development efficiency is too low, and the effect is too bad. It looks too bad and professional. On the other hand, the hmtl interface is convenient and beautiful, and supports script scripts by nature. Very powerful. We generally use B/S structure software for HTML, and a web server is required. In this case, the single-Host Program seems unable to enjoy the convenience and speed of HTML. In fact, there are two solutions. One is to load HTML locally. This solution is poor because we cannot use the powerful respose/requeset/Server objects of the Web server, the code can only be filled with a lot of code that judges strings, which increases the workload. Another solution is to use a local Web server. For example, Apache is open source code. You can change it into a simplified project to provide services. Of course, the Apache server code is too large. You can find some open-source ASP Web server code. If you implement one by yourself, it is not complicated, but it certainly requires a certain amount of work. This is even the core work of this solution. |
You can open an HTML form directly in your project. The Code is as follows: (remember to use the _ stdcall method during compilation) Hinstance hinstmshtml = loadlibrary (text ("mshtml. dll ")); Typedef hresult (* funshowmodelesshtmldialogfn )( Hwnd hwndparent, Imoniker * PMK, Variant * pvarargin, WCHAR * pchOptions, IHTMLWindow2 ** ppWindow ); : CoInitialize (0 ); IHTMLWindow2 * iwnd = 0; If (hinstMSHTML) { FunSHOWMODELESSHTMLDIALOGFN pfnShowModelessHTMLDialog; PfnShowModelessHTMLDialog = (FunSHOWMODELESSHTMLDIALOGFN) GetProcAddress (hinstMSHTML, TEXT ("ShowModelessHTMLDialog ")); If (pfnShowModelessHTMLDialog) { IMoniker * pURLMoniker; BSTR bstrURL = SysAllocString (L "http: // 127.0.0.1/index.html "); CreateURLMoniker (NULL, bstrURL, & pURLMoniker ); If (pURLMoniker) { // DWORD dwFlags = HTMLDLG_MODELESS | HTMLDLG_VERIFY; PfnShowModelessHTMLDialog (NULL, pURLMoniker, NULL, NULL, & iwnd ); PURLMoniker-> Release (); } SysFreeString (bstrURL ); } FreeLibrary (hinstMSHTML ); } Note that the space behind the IHTMLWindow2 interface is displayed. |