C # common methods to call the OCX control,

Source: Internet
Author: User

C # common methods for calling the OCX control [convert],
Our partners often encounter technical troubles when using the various capabilities provided by ICP for integrated development. For example, many interfaces in ICP are provided through OCX controls and how to call these interfaces, this is not a big problem. After all, there is no such content in the Development Guide ~ Don't worry. Today I will introduce you to the common methods used to call the OCX interface in C. Pai_^ y
Original link http://developer.huawei.com/ict/forum/thread-21687.html
Development Environment: win7 Enterprise Edition, vs2010
Control: using voice. ocx as an Example

1. Call the OCX control in the Winform Project

1. Use the regsvr32 console command to register the control;

1.1 open the console and enter the control storage path

1.2 enter the console command: regsvr32 voice. ocx

1.3 Press enter. Creation successful

2. Create a winform in the project;

3. Add a reference to the ocx control for the project;




4. Drag the corresponding. ocx file to the toolbox. The result is as follows;


5. Drag and Drop the control to the form;



6. Call the method in the control (axVoice1 is the "Name" attribute value of the control dragged in the previous step ).



Ii. Call the OCX control in the class library project

1. Copy the. ocx file to the VC folder under the vs2010 installation directory;

2. Use the regsvr32 console command to register the control;

2.1 Open the console and enter the control storage path

2.2 enter the console command: regsvr32 voice. ocx

2.3 Press enter. Creation successful

3. Compile the ocx file

3.1 run the Visual Studio command prompt (2010)

3.2 enter the command aximp Voice. ocx to generate two dll files



4. Copy the dll file generated in the previous step to the project, and the project references the file with the Ax prefix;



5. Call methods in the control.

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.