In visual studio 2008 I can create an MFC activex project and it presents a wizard to create a single activex control. I now want to create new controls within this project.
I can't find any way to do this.
Add an ActiveX control On the Developer tab, in the Controls group, click Insert, and then under ActiveX Controls, select a control, or click More Controls to view all the available ActiveX controls, and then select a control. Click the worksheet location where you want the ActiveX control to appear.
To create an MFC ActiveX Control using the MFC ActiveX Control Wizard. Follow the instructions in the help topic Creating an MFC Application but choose MFC ActiveX Control from the list of available templates. Define your application settings, control names, and control settings using the MFC ActiveX Control Wizard.
I just found that the templates and scripts to generate the ActiveX control code are located in :
Microsoft Visual Studio 9.0\VC\VCWizards\AppWiz\MFC\Control\
There is probably some way to modify that so that it could add a control to an existing project.
I couldn't find a way to do it either.
In VC6 you can specify how many ActiveX controls you want in your (new) project. Maybe you can build the project in VC6 and port it to VC2008.
Otherwise, my best guess is that you duplicate the code of your current ActiveX control. Create two "Ctrl" and "PropPage" classes similar to the ones of the current control, then duplicate the headers in the .odl/.idl file. If it's done right, the new control will appear in Class View and you can add methods, properties and events.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With