Invoke the VC Write dialog box in the Web page

Source: Internet
Author: User
Tags uuid visual studio

To be in the Web page to call VC Write dialog box, then you have to create an OCX, the following will be step-by-step to teach you how to write OCX:

The first step is to choose MFC ActiveX ControlWizard, write the name of the creation project, then press "NEXT" until "finish", so that a simple MFC-type OCX framework has been completed;

The second step is to add a dialog box to the resource and create a new class for the dialog box;

The third step is to add a method for OCX, see figure: Classwizard->add methods, select OK:

Next, add the following code to void COcxtestCtrl::testocx()
{
  CTok test;
  test.DoModal ();
}
the method: Don't forget to add the dialog box class. H file Oh!

The fourth step compiles this OCX bar, after compiling the compiler will register this OCX control, then in "file name. Odl" to look for "project name Control", you will see the following: [ uuid(4FCAE43F-9212-4ECE-A804-D25D792CCEE1),
   helpstring("Ocxtest Control"), control
note the UUID (in the 4fcae43f-9212-4ece-a804-d25d792ccee1 "This string of content, and so on in HTML to use.

The fifth step is to create an HTML file that reads as follows: <HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
<!--
Sub button1_onclick
DOcxtest1.testocx ()
End Sub
-->
</SCRIPT>
</HEAD>
<BODY>
<P>
<INPUT id=button1 type=button value=Button name=button1>
<OBJECT id=DOcxtest1 classid=clsid:4FCAE43F-9212-4ECE-A804-D25D792CCEE1>
<PARAM NAME="_Version" VALUE="65536">
<PARAM NAME="_ExtentX" VALUE="2646">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_StockProps" VALUE="0"></OBJECT>
</P>
</BODY>
</HTML>
Note: The value of the CLSID is changed according to the value registered on the machine, try it!

This article supporting source code

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.