Microsoft ActiveX control pad inserts ActiveX control in HTML webpage.

Source: Internet
Author: User
Development tools:
1. Visual Studio 2005 for ActiveX component development
2. Microsoft ActiveX control pad is used to generate HTML webpages containing ActiveX control.

Steps:
1. Create an MFC ActiveX Control Project Using Visual Studio 2005. After compilation, find a file XXXX. ocx in the debug/release directory. For detailed steps, refer to msdn.

2. Select File> new HTML in ActiveX control pad to create an HTML page.

3. select edit-> insert ActiveX Control... from the ActiveX control pad menu, and a message box will pop up. Select ActiveX control from the list of message boxes and click OK to insert ActiveX control to the HTML page.

4. Open the generated HTML in the local IE browser to see ActiveX Control displayed on the HTML page.

If you place a webpage on the HTTP server, you need to complete some additional steps to allow other computers to access the webpage through IE and make ActiveX components run properly.

The HTML generated by ActiveX control pad looks like the following script:

<HTML>
<Head>
<Title> new page </title>
</Head>
<Body>

<Object ID = "activexcontroltest11" width = 100 Height = 51
Classid = "CLSID: 96908503-3beb-4e2b-aa87-f44dc1_bc0e">
<Param name = "_ version" value = "65536">
<Param name = "_ extentx" value = "2646">
<Param name = "_ extenty" value = "1323">
<Param name = "_ stockprops" value = "0">
</Object>

</Body>
</Html>

Each ActiveX control has a corresponding CLSID, which is unique. You can use the classid attribute of an object to specify the ActiveX contorl ID to find the corresponding ActiveX control. Each ActiveX control must be registered before use. The preceding example runs properly because vs2005 automatically registers ActiveX control when compiling the ActiveX project. ActiveX contorl registration and anti-registration can also be completed through the utility regsvr32.

For example, if codebase attribute is added to the object in HTML, ie can automatically register ActiveX control. The modified HTML Script is as follows:

<HTML>
<Head>
<Title> new page </title>
</Head>
<Body>

<Object ID = "activexcontroltest11" width = 100 Height = 51
Classid = "CLSID: 96908503-3beb-4e2b-aa87-f44dc1_bc0e"
Codebase = "release/activexcontroltest1.ocx">
<Param name = "_ version" value = "65536">
<Param name = "_ extentx" value = "2646">
<Param name = "_ extenty" value = "1323">
<Param name = "_ stockprops" value = "0">
</Object>

</Body>
</Html>

Related links:
Microsoft ActiveX control pad
Http://msdn2.microsoft.com/en-us/library/ms968493.aspx

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.