Re: Create controls library using MFC!
It really doesn't matter whether you statically link it or do it with a DLL,
although most people prefer the DLL route if it's going to be used in more
than one program. Watch out for a few things. Like don't grab the resource
handle (using AfxSetResourceHandle() in you code or you will mess up your
application's resources. It's tricky managing the two, but lots of people
do it. Others simply write control extensions as separate .cpp/.h files and
just include them in projects where they are needed. I think it depends on
your intended use. If you want to sell or distribute your controls (like XT
toolkit, Ultimate Toolbox, BCGSoft, etc.) then you will want to package
integration better. If you're just going to use them internally then you
won't have to be so elegant.
Here's a link the idea Ajay was talking about:
http://msdn2.microsoft.com/en-us/library/h5f7ck28(vs.80).aspx
Tom
"pj" <praneshrj@gmail.com> wrote in message
news:1173970436.468273.21530@n59g2000hsh.googlegroups.com...
Hi,
I am trying to create an abstraction over the MFC control classes so
that it is simplified and/or extended for our usage.
- Firstly, is it a good idea to create a separate project in VC 2005
and build a static library of control classes which I can later use in
different MFC based projects?
- Since stdafx.h (for precompiled header) and afxcmn.h for some MFC
controls had to be included in the same file, I get an error saying do
not include windows.h (which exist in stdafx.h" in MFC apps when I
compile the library. If I remove stdafx.h then it will complain asking
me to include it.
Thanks,
PJ