Click here to Skip to main content
15,888,521 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using WM_USER, WM_APP or RegisterWindowMessage Pin
yccheok12-Dec-10 18:51
yccheok12-Dec-10 18:51 
GeneralRe: Using WM_USER, WM_APP or RegisterWindowMessage Pin
Gary R. Wheeler13-Dec-10 11:45
Gary R. Wheeler13-Dec-10 11:45 
QuestionPassing Array To Function & Displaying Array Contents. Pin
Mike Certini9-Dec-10 18:41
Mike Certini9-Dec-10 18:41 
AnswerRe: Passing Array To Function & Displaying Array Contents. Pin
Cedric Moonen9-Dec-10 20:25
Cedric Moonen9-Dec-10 20:25 
GeneralRe: Passing Array To Function & Displaying Array Contents. Pin
Mike Certini10-Dec-10 8:10
Mike Certini10-Dec-10 8:10 
GeneralRe: Passing Array To Function & Displaying Array Contents. Pin
Stefan_Lang14-Dec-10 6:54
Stefan_Lang14-Dec-10 6:54 
AnswerRe: Passing Array To Function & Displaying Array Contents. Pin
Niklas L10-Dec-10 21:13
Niklas L10-Dec-10 21:13 
QuestionApplication crashes only in release mode (possible heap/stack corruption) Pin
XTAL2569-Dec-10 11:05
XTAL2569-Dec-10 11:05 
Hi all,

I am writing an app using C++, Visual Studio 2008 and Qt. I have been working on a certain section of code, and i have it working now without any problems. That is in debug mode. When i compiled it in release mode the other day, the app crashed (access violation) when i performed a certain action (selecting an item from a combo box). This did not happen in debug mode, and it happens consistently whenever i switch back to compiling in release.

My app is similar to Spy++ or Winspector and it uses a hook to monitor other window's messages. It does this by injecting a DLL in other processes. When i first tried to debug the crash in VS, the stack trace included the hook procedure and it even showed me the code (which is strangle because the DLL should have been built without symbols too). It was indicating that the crash was around the call to CallNextHookEx.
But i don't think it has anything to do with that because when i commented out the hook code, the crash still happened.

I suspect it is due to memory corruption, but i don't know how to be sure. Basically, i am asking for any tips on how to debug such a situation. I cannot step through the code as there are no symbols in release mode, and the DLLs in other processes only makes debugging harder.

Since i have no idea what could be causing the crash, i will not post any code. However, i will upload the entire source (to my SourceForge site) and post a link to it so that you can browse though it if you like.
If it helps, the assembly where the crash happened is:
004320EE mov edx,dword ptr [eax+ecx*4+14h]
[Window Detective] - Windows UI spy utility
modified on Thursday, December 9, 2010 5:50 PM

AnswerRe: Application crashes only in release mode (possible heap/stack corruption) Pin
mbue9-Dec-10 11:49
mbue9-Dec-10 11:49 
AnswerRe: Application crashes only in release mode (possible heap/stack corruption) Pin
Luc Pattyn9-Dec-10 12:19
sitebuilderLuc Pattyn9-Dec-10 12:19 
GeneralRe: Application crashes only in release mode (possible heap/stack corruption) Pin
XTAL2569-Dec-10 13:11
XTAL2569-Dec-10 13:11 
GeneralRe: Application crashes only in release mode (possible heap/stack corruption) Pin
Luc Pattyn9-Dec-10 13:16
sitebuilderLuc Pattyn9-Dec-10 13:16 
GeneralRe: Application crashes only in release mode (possible heap/stack corruption) Pin
XTAL2569-Dec-10 17:48
XTAL2569-Dec-10 17:48 
GeneralRe: Application crashes only in release mode (possible heap/stack corruption) Pin
Luc Pattyn9-Dec-10 22:47
sitebuilderLuc Pattyn9-Dec-10 22:47 
GeneralRe: Application crashes only in release mode (possible heap/stack corruption) Pin
XTAL2569-Dec-10 23:21
XTAL2569-Dec-10 23:21 
AnswerRe: Application crashes only in release mode (possible heap/stack corruption) Pin
Rajesh R Subramanian9-Dec-10 17:26
professionalRajesh R Subramanian9-Dec-10 17:26 
AnswerRe: Application crashes only in release mode (possible heap/stack corruption) Pin
XTAL25612-Dec-10 12:09
XTAL25612-Dec-10 12:09 
QuestionC Casting Problem Pin
Andy2029-Dec-10 8:14
Andy2029-Dec-10 8:14 
AnswerRe: C Casting Problem Pin
Luc Pattyn9-Dec-10 9:01
sitebuilderLuc Pattyn9-Dec-10 9:01 
GeneralRe: C Casting Problem Pin
Andy2029-Dec-10 10:41
Andy2029-Dec-10 10:41 
GeneralRe: C Casting Problem [modified] Pin
Luc Pattyn9-Dec-10 11:06
sitebuilderLuc Pattyn9-Dec-10 11:06 
AnswerRe: C Casting Problem Pin
mbue9-Dec-10 12:07
mbue9-Dec-10 12:07 
QuestionSave image from picturebox use MFC Pin
josipahutar9-Dec-10 8:02
josipahutar9-Dec-10 8:02 
AnswerRe: Save image from picturebox use MFC Pin
mbue9-Dec-10 12:16
mbue9-Dec-10 12:16 
GeneralRe: Save image from picturebox use MFC Pin
tagopi9-Dec-10 17:08
tagopi9-Dec-10 17:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.