Software Interface Using HTML/asp

Source: Internet
Author: User

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.

Of course, you can also use ShowHTMLDialogEx.

The rest of the work is simple, just develop your own ASP background. The program is developed visually and quickly.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.