WinMobile: Inter Process Communication

H

Harry Hirsch

Hello,

I just started to program for Windows Mobile 5.0 using VisualStudio 2005 and
C#. I'm looking for "inter process communication". In C++/MFC I use named
CMutex and named CEvent objects, and I sent messages to other processes
using FindWindow() and PostMessage().
All these things are not available in the Compact Framework 2.0. I tried
[DllImport] but there are no "user32.dll" or "coredll.dll" on the machine...
Is there anybody to give me a tip? Thanks!

Harry Hirsch
 
P

Peter Foot [MVP]

There most definitely is a coredll.dll (it's present on all Windows CE
devices), but the file is normally hidden. There is a rundown of IPC methods
here:-
http://www.danielmoth.com/Blog/2004/09/ipc-with-cf-on-ce-part-1.html
http://www.danielmoth.com/Blog/2004/09/ipc-with-cf-on-ce-part-2.html

To use a named mutex P/Invoke CreateMutex:-

[DllImport("coredll.dll")]
private static extern IntPtr CreateMutex(
int lpMutexAttributes,
bool bInitialOwner,
string lpName);

You can then pass the resulting handle to an instance of the Mutex class in
..NETCF by setting the Handle property.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top