Click here to Skip to main content
15,899,026 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Custom Message From Child Dialog Pin
zakkas24839-Feb-09 20:44
zakkas24839-Feb-09 20:44 
GeneralRe: Custom Message From Child Dialog Pin
SandipG 9-Feb-09 21:13
SandipG 9-Feb-09 21:13 
GeneralRe: Custom Message From Child Dialog Pin
zakkas24839-Feb-09 21:36
zakkas24839-Feb-09 21:36 
GeneralRe: Custom Message From Child Dialog Pin
Sarath C9-Feb-09 21:19
Sarath C9-Feb-09 21:19 
GeneralRe: Custom Message From Child Dialog Pin
zakkas24839-Feb-09 21:30
zakkas24839-Feb-09 21:30 
GeneralRe: Custom Message From Child Dialog Pin
zakkas24839-Feb-09 21:39
zakkas24839-Feb-09 21:39 
GeneralRe: Custom Message From Child Dialog Pin
Sarath C9-Feb-09 23:21
Sarath C9-Feb-09 23:21 
AnswerRe: Custom Message From Child Dialog Pin
Iain Clarke, Warrior Programmer9-Feb-09 22:12
Iain Clarke, Warrior Programmer9-Feb-09 22:12 
You already have the solution to your problem - add in the WPARAM & LPARAM parameters.

But you want to know why it worked in debug, and not in release mode?

Do a search in the MFC code directorys for ON_MESSAGE, and you can see the definition of the macro. You can see that MFC is calling casting your function to a format that includes the two parameters.

In release mode, calling a function with parameters will put those parameters on the stack. Your function does not use them, so it does not pull them off the stack. I got "stack corruption" errors when I had this same fault (a long time ago now!)

In debug mode, my theory there is plenty of padded memory about, or the calling conventions do not use the stack. Either way - when it worked in debug mode, you were just lucky.

(Or unlucky - I'd prefer to fix the problem as soon as possible!)

My experience was with VC++ 6 - I think later versions of MFC do things a little differently, without casts in the ON_xxxxx message maps, so it's harder to have this fault.

Iain.

Codeproject MVP for C++, I can't believe it's for my lounge posts...

GeneralRe: Custom Message From Child Dialog Pin
zakkas24839-Feb-09 23:24
zakkas24839-Feb-09 23:24 
QuestionCheck Boxes - Mutually Exclusive Pin
Anandi.VC9-Feb-09 18:27
Anandi.VC9-Feb-09 18:27 
AnswerRe: Check Boxes - Mutually Exclusive Pin
«_Superman_»9-Feb-09 19:10
professional«_Superman_»9-Feb-09 19:10 
GeneralRe: Check Boxes - Mutually Exclusive Pin
Anandi.VC9-Feb-09 19:57
Anandi.VC9-Feb-09 19:57 
AnswerRe: Check Boxes - Mutually Exclusive Pin
Iain Clarke, Warrior Programmer9-Feb-09 22:16
Iain Clarke, Warrior Programmer9-Feb-09 22:16 
AnswerRe: Check Boxes - Mutually Exclusive Pin
Eytukan9-Feb-09 22:39
Eytukan9-Feb-09 22:39 
AnswerRe: Check Boxes - Mutually Exclusive Pin
CPallini9-Feb-09 23:24
mveCPallini9-Feb-09 23:24 
AnswerRe: Check Boxes - Mutually Exclusive Pin
«_Superman_»10-Feb-09 1:42
professional«_Superman_»10-Feb-09 1:42 
GeneralRe: Check Boxes - Mutually Exclusive Pin
Shog910-Feb-09 7:07
sitebuilderShog910-Feb-09 7:07 
GeneralRe: Check Boxes - Mutually Exclusive Pin
«_Superman_»10-Feb-09 17:25
professional«_Superman_»10-Feb-09 17:25 
GeneralRe: Check Boxes - Mutually Exclusive Pin
Shog910-Feb-09 18:24
sitebuilderShog910-Feb-09 18:24 
QuestionATL DLL Pin
sam_psycho9-Feb-09 18:24
sam_psycho9-Feb-09 18:24 
AnswerRe: ATL DLL Pin
_AnsHUMAN_ 9-Feb-09 19:33
_AnsHUMAN_ 9-Feb-09 19:33 
GeneralRe: ATL DLL Pin
sam_psycho9-Feb-09 21:11
sam_psycho9-Feb-09 21:11 
GeneralRe: ATL DLL Pin
_AnsHUMAN_ 9-Feb-09 22:13
_AnsHUMAN_ 9-Feb-09 22:13 
AnswerRe: ATL DLL Pin
Rahul Vaishnav9-Feb-09 22:10
Rahul Vaishnav9-Feb-09 22:10 
QuestionApplication patch updates in Normal User login Pin
SNI9-Feb-09 17:31
SNI9-Feb-09 17:31 

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.