hi, passing string through Message Window.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi, I have two C# Compact Framework applications. I want to make Interprocess communication between the applications by Message Window. Does any one know how to do it
I using MarshalEx.StringToHGlobalUni(message); to convert the message into IntPtr and pass this IntPtr and unmarshal it in the otherside by calling Marshal.PtrToStringUni(wParam); to unmarshal the int pointer back to string. However this doesn't work. Since these two applications are not sharing the same memory pool. Any one know how to resolve this
Or if MessageWindow is not a proper way to do it, what are other choices out there
Please Help, Great Appreciate. Thanks

Regardless, Wayne
 
The MarshalEx.StringToHGlobalUni is using LocalAlloc call behind the sceen
which will work inside of one process only. For interprocess you'd better
off by using WM_COPYDATA message.


--
Alex Yakhnin .NET CF MVP
www.intelliprog.com | www.opennetcf.org

liu_wayne10 said:
hi, I have two C# Compact Framework applications. I want to make
Interprocess communication between the applications by Message Window. Does
any one know how to do it?
I using MarshalEx.StringToHGlobalUni(message); to convert the message into
IntPtr and pass this IntPtr and unmarshal it in the otherside by calling
Marshal.PtrToStringUni(wParam); to unmarshal the int pointer back to string.
However this doesn't work. Since these two applications are not sharing the
same memory pool. Any one know how to resolve this?
 
hi, Alex: Thanks for the information. I finally get it working. I can send string and read it in the other end
However, I am running my applications in IPAQ. Whenever I send the string, "Hello". IPAQ popup a window ask Data "Hello" Received. Do you want to receive it? "YES"/"NO". Do you know how to avoid this popup window code wise or
from the IPAQ setting?

Thanks for you information, help me a lot

Regardless, Wayne
 
Could you show the code you're using?

--
Alex Yakhnin .NET CF MVP
www.intelliprog.com | www.opennetcf.org

liu_wayne10 said:
hi, Alex: Thanks for the information. I finally get it working. I can
send string and read it in the other end.
However, I am running my applications in IPAQ. Whenever I send the
string, "Hello". IPAQ popup a window ask Data "Hello" Received. Do you
want to receive it? "YES"/"NO". Do you know how to avoid this popup window
code wise or
from the IPAQ setting??

Thanks for you information, help me a lot.
Regardless, Wayne
 
I don't see anything wrong with the code.

Which IPAQ is that? What OS it is running?
 
Back
Top