There are 2 ways to create an ActiveX control in an MFC application :
1. Via the Window/Dialog Box.
1.1 If you have inserted an ActiveX control in a dialog box via the dialog editor, the wrapper classes for your ActiveX control would be generated automatically by the MFC Wizard.
1.2 You would also need to add a variable in your Window/Dialog Box class of type control.
1.3 Do not call CWnd::Create() of your ActiveX wrapper class.
1.4 This is because the ActiveX control objeect would already be created when your Window/Dialog Box is created.
2. Dynamically in Code.
2.1 Use the "Project"|"Add Class" menu item to insert an MFC class from an ActiveX control.
2.2 The wrapper class for your ActiveX will be generated (.h and .cpp files).
2.3 You would also need to add a variable in your Window/Dialog Box class of type control.
2.4 This time, you -do- need to call the CWnd::Create() method of your ActiveX wrapper class.
Last Visit: 31-Dec-99 18:00 Last Update: 24-Aug-16 19:35