I have written a C++/CLI library that exports a class with two generic functions:
public ref class TargetInterface
{
public:
static uint32_t buffer_length = 4096;
TargetInterface();
static bool Connect(char* deviceAdress);
static void Disconnect(char* deviceAdress);
generic<typename T>CommunicationState WriteProtobufMessage( T object);
generic<typename T>CommunicationState ReadProtobufMessage([Out] T object);
};
The dll compiles fine. When I try to use this functions in my C# project I get the error:
WavelabsLightsourceSystem.TargetInterface.ReadProtobufMessage<T>(T)' is inaccessible due to its protection level
Here is the c# part where I try to use the Funktions:
pb_MessageHeader header = new pb_MessageHeader();
TargetInterface target = new TargetInterface();
target.ReadProtobufMessage<pb_MessageHeader>(header);