Click here to Skip to main content
15,889,780 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hii all
when i set Use MFC in a Shared Dll the Programe is crash on Relese mode.Using Use MFC in a Static Library It is working corectly.
Can ay one help me
Posted
Comments
Richard MacCutchan 27-Oct-11 5:36am    
You first need to try and establish exactly (or about) where the program is crashing. With that information and seeing some of your code someone may be able to help. Without that information it is impossible to guess.
Himansu sekhar bal 27-Oct-11 5:40am    
when i create a worker thread
Richard MacCutchan 28-Oct-11 8:38am    
And that's supposed to be a technical description of your problem?
Albert Holguin 27-Oct-11 11:05am    
Does the program work fine in Debug mode for both static and shared? Does the program work fine in Release mode for static? ...can you see in the call stack where the crash occurred?
Himansu sekhar bal 28-Oct-11 1:10am    
it is working debug mode fine for both static and shared,working fine in Release mode for static

After you switch this type of project setting, it is important to ensure that you do a complete rebuild of each configuration for your project. Including other static libraries that you may be using. There are different symbols #defined by MFC for these project settings and that will effect a difference on the object code produced during compilation. Also check to ensure that no other DLL that your application is loading, uses MFC in a shared DLL as well. I might be wrong, but I think this is incompatable as well.
 
Share this answer
 
Comments
Andrew Brock 28-Oct-11 9:16am    
My 5. I can't count the number of times this has happened to me.
Chris Meech 28-Oct-11 9:29am    
Thanks Andrew. Hopefully others can learn from our bruises and scars. :)
If you bind another library to your project that also uses MFC, then this library must use the same binding (dynamic or static) as your own project. When I migrated a project from VS 2003 to VS 2010 I found that in VS 2003 this was not a problem, but in VS 2010 it was!
 
Share this answer
 
Comments
Albert Holguin 28-Oct-11 17:15pm    
Yeah, found this out migrating code from VS6 to VS2008... +5

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