Dave,
It shouldn't return a different number. The window messages and the
strings they are mapped to are scoped on the machine level. The only way
they could be different was if the strings were not the same.
Are you sure that the strings match? Also, what is the version of the
API that is called by the unmanaged C++ application? Is it the Ansi version
(A) or the Unicode version (W)? If so, you should make sure that you are
calling the same conversion (so that you don't have issues with marshaling).
The same goes for the call to PostMessage.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"Dave" <be******@netvision.net.il> wrote in message
news:ut**************@TK2MSFTNGP15.phx.gbl...
Hi,
I am sending windoew message from a c# application to c++(unmanage)
application using this code
System.UInt32 rm= RegisterWindowMessage("12345");
System.IntPtr ptr=(IntPtr)HWND_BROADCAST;
PostMessage(ptr,(int)rm,5,5);
PostMessage(ptr,WM_AAA,5,5);
but the c++(vc-6 mfc) dont catch the message, when i use the
RegisterWindowMessage("12345"); in the c++ application it return a
diffrent
number from that in the c# application why?
Thanks.