|
-
April 20th, 1999, 05:06 AM
#1
SendMessage problems
Hi Gurus !
I have a problem with SendMessage().
In a modal dialog I make this call:
...
m_pParent->SendMessage( WM_UPDATE_DATA, m_sData );
...
'm_pParent' is a valid pointer to 'CMyMainFrm' class and the handler for the message 'WM_UPDATE_DATA' is placed in there.
Now the problem:
All works fine, if my code is compiled in debug mode. But if I compile it in release mode it breaks.
What happens is:
The message handler process the message correct.
But than the program breaks with this message:
"Unhandled exception in Myapp.exe(MFC42.DLL):0xC00000005: Access Violation."
and the debugger jumps to following code into the file 'mfc\src\Map_pp.cpp':
void* CMapPtrToPtr::GetValueAt(void* key) const
// find value (or return NULL -- NULL values not different as a result)
{
...
}
Why does my code work in debug mode but not in release mode.
What should I do to compile my code correct ??
Thanks for reading
Bye Joerg
-
April 21st, 1999, 02:15 PM
#2
Re: SendMessage problems
And when U uses PostMessage instead of SendMessage... Because your dialog is Modal ??
Nath.
-
April 21st, 1999, 02:40 PM
#3
Re: SendMessage problems
your function have to be
OnFunc(WPARAM wParam, LPARAM lParam)
-
April 21st, 1999, 09:26 PM
#4
Re: SendMessage problems
Even if you just use the WPARAM parameter, both WPARA and LPARAM are used by the system. LPARAM in this case defaults to zero, so your function prototype NEED to be declared with BOTH WPARAM and LPARAM. Are they?
sally
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|