Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi.

I am trying to make some reusable GUI components for several desktop application projects. These projects are all Windows (Win7), Visual Studio, C++ based. What do you think would be the best way to approach this problem?

Right now i was thinking about one of these 2 ideas:
- MFC ActiveX Control.
- MFC extension Dll.

So far ActiveX has the benefit of being able to be integrated directly in the VS resource editor and this would make the integration easier.
On the other hand, ActiveX would allow only 1 GUI component per .OCX (am i wrong here? is it possible to incorporate more that 1 control in an .OCX file?) and this would mean that i would have to distribute a lot of .OCX files and it would just not look right.
Can you tell me if ActiveX is still considered a "modern" way of doing things? I wouldn't want to use something that is about to be deprecated.

Thanks.
Posted
Updated 17-Dec-14 1:19am
v2

My choice would be a DLL that exports a simple C interface - essentially something to initialise the library and register all the window classes. Whether you use another library (e.g. MFC) to implement your controls doesn't then matter for the client of your code.

The reasoning behind that is that it's relatively simple to wrap other stuff around a simple set of WIN32 windows classes while it's a right royal pain in the bottom the other way around.
 
Share this answer
 
A single DLL can actually host multiple controls (see, for instance, ComCtl32.dll).
COM is far 'more modern' than MFC, in my opinion (for instance, WinRT is COM-based[^]).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900