Click here to Skip to main content
16,005,038 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: hw to find out a possible combination Pin
Stephen Hewitt22-Jan-07 11:29
Stephen Hewitt22-Jan-07 11:29 
Questionneed help... Pin
baby_fong8222-Jan-07 2:22
baby_fong8222-Jan-07 2:22 
AnswerRe: need help... Pin
Waldermort22-Jan-07 2:38
Waldermort22-Jan-07 2:38 
QuestionWindows Message handling in Debug and Release build of Dialog Based MFC Application Pin
HetalAgrawal22-Jan-07 2:15
HetalAgrawal22-Jan-07 2:15 
AnswerWill the noobs stop posting badly ??? Pin
toxcct22-Jan-07 2:17
toxcct22-Jan-07 2:17 
GeneralRe: Will the noobs stop posting badly ??? Pin
James R. Twine22-Jan-07 3:19
James R. Twine22-Jan-07 3:19 
AnswerTo the one with the empty head Pin
Waldermort22-Jan-07 2:33
Waldermort22-Jan-07 2:33 
AnswerRe: Windows Message handling in Debug and Release build of Dialog Based MFC Application Pin
Mike O'Neill22-Jan-07 13:30
Mike O'Neill22-Jan-07 13:30 
wrote:
I want to know what is the reason behind this?? why such difference in Debug and Release build ??


Stack corruption causes the crash. The correct signature of a message handler, the function takes a WPARAM and an LPARAM (which are pushed onto the stack when the function is called) and returns an LRESULT (which is popped from the stack when the function returns). In the incorrect version of your code, the fun() function is being called as if it had this signature, even though the fun() function does not, and as a result there is stack corruption.

The fact that it works in debug mode is a coincidence, possibly due to padding added by the compiler in debug compilations.

Incidentally, are you still using VC 6.0? The error in signatures for message handlers is flagged as a compiler error in newer versions of Visual Studio.

Mike
QuestionHow to capture mouse events from a control within a Dialog Box? Pin
Arris7422-Jan-07 2:02
Arris7422-Jan-07 2:02 
AnswerRe: How to capture mouse events from a control within a Dialog Box? Pin
prasad_som22-Jan-07 2:20
prasad_som22-Jan-07 2:20 
AnswerRe: How to capture mouse events from a control within a Dialog Box? Pin
Arris7422-Jan-07 6:07
Arris7422-Jan-07 6:07 
AnswerRe: How to capture mouse events from a control within a Dialog Box? Pin
prasad_som24-Jan-07 17:32
prasad_som24-Jan-07 17:32 
GeneralRe: How to capture mouse events from a control within a Dialog Box? Pin
Arris7427-Jan-07 6:52
Arris7427-Jan-07 6:52 
AnswerRe: How to capture mouse events from a control within a Dialog Box? Pin
Waldermort22-Jan-07 2:28
Waldermort22-Jan-07 2:28 
AnswerRe: How to capture mouse events from a control within a Dialog Box? Pin
Arris7422-Jan-07 6:33
Arris7422-Jan-07 6:33 
QuestionPass a sting to a dll that neads a WCHAR Pin
Calvin Streeting22-Jan-07 2:02
Calvin Streeting22-Jan-07 2:02 
GeneralRe: Pass a sting to a dll that neads a WCHAR Pin
toxcct22-Jan-07 2:15
toxcct22-Jan-07 2:15 
AnswerRe: Pass a sting to a dll that neads a WCHAR Pin
James R. Twine22-Jan-07 3:01
James R. Twine22-Jan-07 3:01 
GeneralRe: Pass a sting to a dll that neads a WCHAR Pin
Calvin Streeting22-Jan-07 3:30
Calvin Streeting22-Jan-07 3:30 
GeneralRe: Pass a sting to a dll that neads a WCHAR Pin
James R. Twine22-Jan-07 4:27
James R. Twine22-Jan-07 4:27 
GeneralRe: Pass a sting to a dll that neads a WCHAR Pin
Calvin Streeting22-Jan-07 4:53
Calvin Streeting22-Jan-07 4:53 
GeneralRe: Pass a sting to a dll that neads a WCHAR Pin
James R. Twine22-Jan-07 5:08
James R. Twine22-Jan-07 5:08 
GeneralRe: Pass a sting to a dll that neads a WCHAR Pin
Calvin Streeting22-Jan-07 5:21
Calvin Streeting22-Jan-07 5:21 
GeneralRe: Pass a sting to a dll that neads a WCHAR Pin
James R. Twine22-Jan-07 8:09
James R. Twine22-Jan-07 8:09 
GeneralRe: Pass a sting to a dll that neads a WCHAR Pin
Calvin Streeting22-Jan-07 9:30
Calvin Streeting22-Jan-07 9:30 

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.