How do I add MFC ActiveX control to an existing ac

2019-04-29 03:54发布

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.

4条回答
来,给爷笑一个
2楼-- · 2019-04-29 04:10

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.

查看更多
放我归山
3楼-- · 2019-04-29 04:13

Each project in Visual Studio 2008 can only have one output (EXE, DLL etc.). If you want several outputs, create a solution. The solution wil contain your existing projects. And you can create additional projects, e.g. for an ActiveX control

The projects in a solution can share code, use the same settings cand configuration, and they can be built together.

(Don't you happend to already have a solution? I thought that Visual Studio 2008 always creates a solution, even for single projects.)

查看更多
聊天终结者
4楼-- · 2019-04-29 04:25

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.

查看更多
该账号已被封号
5楼-- · 2019-04-29 04:34

Menu->Project->Add Class->now add an empty MFC active x control class...

查看更多
登录 后发表回答