I am working with C++ files/classes that run a VoIP engine and I wanted a GUI to interface with these C++ classes, so I've been using CLI to get a .NET form going.
The engine is based on Teamspeak and i've created my form like this;
/* C++ Class */#include "TeamspeakClient.h"namespace TS_Client {using namespace System;using namespace System::....public ref class TSForm : public System::Windows::Forms::Form {public:TSForm(void);protected: ~TSForm();public:TeamspeakClient *TeamSpeak;
So say when someone presses the connect button on the form, it runs Teamspeak->Connect(). I've had no problems with this design for some time, but I've gotten to a point where the C++ engine requires thread management. Inside the TeamspeakClient
header, it includes things like std::mutex and std::thread. When I attempt to build I get errors in my TSForm similar to this;
C1189: #error : <mutex> is not supported when compiling with /clr or /clr:pure.
So how can I use my TSForm to interface with my C++ object? I can't see a possible solution without doing#include "TeamspeakClient.h" In my TSForm.
Clearly my work needs some re-design or something, any help strongly appreciated