I have a C++ application that maintains a couple of in memory data stores (vector/map in c++). I need to access these data stores from a C# application, preferably some kind of service (WCF) so I can expose it further to a web application. I will be looking at creating a C++/CLI wrapper next week but wanted to ask ahead of time if this will be able to do what I need? I am very new to C++ and usually just work with the .Net framework. Another option is to try and get the existing C++ application running as C++/CLI but I would prefer to try the wrapper approach first if possible. Or try something else entirely if there is a better way?
I have a test C# console application that is able to call C++ code exposed as a static library or a dynamic library and am comfortable with this now. From what I understand it does this using the DLLImport/P-invoke process. My problem is I need the C++ exe actually running rather than just exposing functions. I have tried to get the C# application to start a thread within the C++ program by calling a function within the C++ app but I receive a memory access violation so assume this can't be done?
[DllImport("DynamicLib.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void startServiceThread();