Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ MFC
I am on working on application on VS2008 MFC, where I am refering a third party lib file, which works fine on release build of my application.
 
the method signature which I called in my application in this way...
 
CXerror::Init(path,filename,path);
 
This method is their in the lib file. which works fine when I build in Release mode of my application. But when same code is called in debug mode I am getting error saying
 

 
"First-chance exception at 0x003a60e3 in My.exe: 0xC0000005: Access violation reading location 0x003a607e."
 
and My.exe exits.
 
can you share some info on this ...
Posted 19-Nov-12 19:27pm
preang187
Edited 19-Nov-12 19:28pm
v2
Comments
Argonia at 22-Nov-12 11:12am
   
Ok first i work on Visual Studio 2010 so maybe the next i write isn't entirely true . First like i see it i think maybe you don't call the lib right and the method you call is trowing an exception. You can try to debug it with Disassembly window (if there is such thing in VS 2008) and see exactly where the error is thrown. Maybe you need to call some other function before this one.
The other thing you can try i enable all Exceptions (Ctrl + Alt + E in VS 2010) to see if some variable initialization is going wrong or something like that .
Good luck

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If your app uses libraries, make sure that you link to the same C runtime library (CRT)(e.g. if it uses Multithreaded DLL you too need to link the same CRT with your app). Otherwise, you will get access violation errors.
 
Since the 3rd party DLL must be a release build DLL, it must have been linked to release version of CRT. While, in debug build, your app will link to debug version of CRT. Ask the supplier of the DLL to provide you with a debug version of their library also. In debug build, you can link it to the debug version of their DLL.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 480
1 Gihan Liyanage 225
2 OriginalGriff 174
3 Bhavik_Patel 170
4 PhilLenoir 155
0 Sergey Alexandrovich Kryukov 8,653
1 OriginalGriff 7,132
2 CPallini 2,598
3 Richard MacCutchan 2,060
4 Abhinav S 1,808


Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 20 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100