- MFC Tutorial
- MFC - Home
- MFC - Overview
- MFC - Environment Setup
- MFC - VC++ Projects
- MFC - Getting Started
- MFC - Windows Fundamentals
- MFC - Dialog Boxes
- MFC - Windows Resources
- MFC - Property Sheets
- MFC - Windows Layout
- MFC - Controls Management
- MFC - Windows Controls
- MFC - Messages & Events
- MFC - Activex Controls
- MFC - File System
- MFC - Standard I/O
- MFC - Document View
- MFC - Strings
- MFC - Carray
- MFC - Linked Lists
- MFC - Database Classes
- MFC - Serialization
- MFC - Multithreading
- MFC - Internet Programming
- MFC - GDI
- MFC - Libraries
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
MFC - Activex Control
An ActiveX control container is a parent program that supplies the environment for an ActiveX (formerly OLE) control to run.
ActiveX control is a control using Microsoft ActiveX technologies.
ActiveX is not a programming language, but rather a set of rules for how applications should share information.
Programmers can develop ActiveX controls in a variety of languages, including C, C++, Visual Basic, and Java.
You can create an application capable of containing ActiveX controls with or without MFC, but it is much easier to do with MFC.
Let us look into simple example of add ActiveX controls in your MFC dialog based application.
Step 1 − Right-click on the dialog in the designer window and select Insert ActiveX Control.
Step 2 − Select the Microsoft Picture Clip Control and click OK.
Step 3 − Resize the Picture control and in the Properties window, click the Picture field.
Step 4 − Browse the folder that contains Pictures. Select any picture.
Step 5 − When you run this application, you will see the following output.
Let us have a look into another simple example.
Step 1 − Right-click on the dialog in the designer window.
Step 2 − Select Insert ActiveX Control.
Step 3 − Select the Microsoft ProgressBar Control 6.0, click OK.
Step 4 − Select the progress bar and set its Orientation in the Properties Window to 1 – ccOrientationVertical.
Step 5 − Add control variable for Progress bar.
Step 6 − Add the following code in the OnInitDialog()
Step 7 − When you run this application again, you will see the progress bar in Vertical direction as well.