VC + + Write ActiveX control

Source: Internet
Author: User

The ActiveX technology is implemented by generating "*.ocx" files. First to understand the next OCX file, in the Baidu Encyclopedia on the face of OCX is this explanation: ". ocx is an extension of the OCX control, and OCX is an object category extender. If you've used Visual Basic or Delphi's visual programming tools, then the concept of the control is not unfamiliar, it is the small buttons on the toolbar, such as Editbox,grid,imagebox,timer and so on. Each control has its own events, methods, and properties. Programming with controls is easy. First of all, in the design phase of the program can set some properties, such as size, position, title (caption), etc., in the program run phase, you can change these properties, you can also call different methods for different events to implement control of the control. A control is like a block of bricks, and the only thing the program does is to put the bricks together. The biggest benefit of a control is that it can be reused and even used between different programming languages, such as you can embed controls developed with VC in VB. "
In the last word is more important, is the use of VC development of OCX control, you can be in other languages can be called, so that the good implementation of the functional components of the good recycling, but also can be implemented in a cross-language call (for example, you can call C + + development of the OCX control). Steps/Methods
    1. 1 here's how to create the "*.ocx" file you want with VC + + step-by-step.
      1. Create the simplest OCX file and debug it
      1.1 Creating the simplest OCX file
    2. 2 vc-> New Project->mfc ActiveX Winzard
    3. 3 Click "OK" all the way until you click "Finish". Finally VC + + will automatically generate some files, these files constitute the basic ActiveX template, the main structure of the file is as follows:
    4. 4 compile directly and then generate a control registration file named "Ocxdemo.ocx" under the Debug directory, and then use the "regsvr32" command to register the control natively. You can then refer to this control to implement the appropriate functionality (as described later) by using this language or writing programs across languages.

VC + + Writing ActiveX controls

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.