Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easy IPC on Windows Mobile?

In a C++ project (i.e. no .NET) on Windows Mobile, I am looking for a way to easily communicate between two independently running applications. Application A would run a service, whereas application B would provide the user some functionality - for which B has to call some of A's functions. I would rather not go through implementing anything in COM.

In fact, I would prefer not to do any kind of serialization or similar (i.e. this would exclude using sockets/pipes/files), but rather have B pass all parameters and pointers over to A, just like if A were part of B. Also, apps C, D and E should be able to do the same with only one instance of A running.

I should add that B sometimes is supposed to return an array (or std::vector or std::map) to A where the size is not previously known.

Is this possible on Windows Mobile and possibly other platforms?

like image 258
Steven Avatar asked Oct 14 '08 07:10

Steven


1 Answers

You can't just share data across processes. I don't recommend COM. Pipes do not exist in Windows CE. Your best route is either a memory mapped file (like on the desktop) or a point to point message queue (nothing like on the desktop). Which is better depends on your usage scenario.

Do not try to use cross process memory with VirtualAlloc as suggested, as it's an unsafe hack unsafe and is not supported on CE 6.0 or later so you'll end up breaking under WinMo 7 and later.

I do not recommend using windows messages and WM_COPYDATA. It's slow, kludgy, and highly prone to errors.

People, please don't just answer questions when you've not used the platform just to try to gain reputation points. If you don't know the platform, let someone else help the guy instead of sending him on a wild goose chase.

like image 147
ctacke Avatar answered Nov 18 '22 17:11

ctacke