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.