Click here to Skip to main content
15,891,607 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

My application(COM dll) was in VS2003.I upgraded it into VS2005.For using Encoding

class(.NET Framework Class) changed the Common Language Runtime Support settings to

/clr and Use MFC in a Shared DLL.After building my application I got the error as

"Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll

version. Please #define _AFXDLL or do not use /MD[d]".

What I have to set in "Code Generation" settings for getting zero error.Please note

that I defined "_AFXDLL" in Preprocessor settings.

Thanks in advance
Posted

1 solution

Remove #include "Windows.h" statements if you have any

and then check the sequence of the include directories, Try to alter it.(Tools->options->Project and solutions->VC++ directories )
 
Share this answer
 
Comments
kutz 2 1-Aug-11 3:17am    
The included files are in the order

$(frameworkSDKDir)include
$(VCInstallDir)PlatformSDK\include
$(VCInstallDir)atlmfc\include
$(VCInstallDir)include

I changed this order in different ways.But still getting the same error.
PrafullaVedante 1-Aug-11 3:24am    
Just try to create a new COM project in the VS 2005 with the MFC as a shared library. And observe the stdafx.h . Copy these entries to your stdafx.h

I doubt if atl.h or some header file needs to be included in stdafx.h

This is just a guess ...... but see if it works for you.
kutz 2 1-Aug-11 6:08am    
I tried the above one also.But still getting the error

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