Scott Fraser
Scott Fraser

Reputation: 11

Windows Compact Embedded: Calling C# DLL from C++

I am attempting to call a C# .NET DLL from an unmanaged C# application. I have tried writing a C++/CLI wrapper but was unable to compile for a CE target. After some digging through many form posts it is the general consensus that C++/CLI is not supported for WinCE however I have not found an official Windows document supporting that. I have also tried creating a COM wrapper for my DLL which compiles fine however fails to create an instance of the wrapped object at runtime. I have registered my COM component correctly but it seems that it is also not supported.

Does anyone know of:

  1. Any workarounds to get C++/CLI or COM to work for WinCE 2013.
  2. A preferred method of Inter-Process Communication between C++ and C# applications.

Upvotes: 0

Views: 146

Answers (1)

ctacke
ctacke

Reputation: 67168

There really are no workarounds since hosting doesn't exist. You need to use IPC, and which is "best" really depends on your use case. Memory-mapped files work well for data sharing, sockets or named events for commands. Unlike the desktop, CE supports sending a simple 32-bit value with a named event as well (SetEventData IIRC?) which can be super lightweight and handy in some cases.

Upvotes: 0

Related Questions