Thursday, October 22, 2015

Mfc Activex Tutorial

The ActiveX Control program is used by programmers to configure how different applications communicate and share information. ActiveX can be used with various programming languages, including Java, C++ and Virtual Basic. While ActiveX Controls can be developed using different tools, the MFC, or Microsoft Foundation Classes, tool is the most common. Developing an ActiveX Control using MFC requires knowledge of C++ programming code.


Instructions


Creating the Skeleton


1. Open a programming project and select "Create New."


2. Under the "Projects" tab, select MFC ActiveX ControlWizard.


3. Select the number of controls you want to create and adjust the settings as desired. Click "Next" and then "Finish."


Adding Components


4. Right click on the interface. Select the component you wish to add: "Method," "Properties," "Events" or "PropertyPages."


5. Select an external name from the drop-down box to add a stock component.


6. Click on the "Custom" button and write your own component code to create a custom control.


Using the ActiveX Control


7. Go to "Project" and select "Add To Project." Select "Components and Controls" from the menu.


8. Drag the ActiveX Control you just created into the dialog.


9. Open the "Class Wizard" and add a member variable that corresponds to your control.