• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1200
  • Last Modified:

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      
      
0
pj_bennett
Asked:
pj_bennett
1 Solution
 
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

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now