Adding MFC support to an ATL DLL

Hi,
I have an ATL project and I need to add a pop up dialog to it using MFC, when I add the MFC libraries in the project properties, the system throws a linking error:

Error      5      error LNK2005: _DllMain@12 already defined in TestDLL.obj      uafxcwd.lib
Error      6      fatal error LNK1169: one or more multiply defined symbols found      

I've looked up the Error on MS but the solution makes no sence!!

Can anyone help? I'm using VS2005 if that makes a difference.

Cheers      
      
pj_bennettAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AndyAinscowFreelance programmer / ConsultantCommented:
Put the MFC dialog in another (MFC) dll ?
You can then use LoadLibrary and related funtions to call the MFC dialog.
0
DanRollinsCommented:
Have you read:
   How to add MFC support to an ATL project in Visual C++
   http://support.microsoft.com/kb/q173974/

Another reasonable idea:  Start over with a new project, this time electing in the AppWizard to use MFC support.  Then add-in the code you've written.  Often times, such a rewrite actually improves the code.

Finally:  It is perfectly possible to display a dialog box in an ATL project.  It may not be necessary to add MFC support at all.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.