I am working on a project where I write an application in C#. I want to use a .dll file and to bind the functions of it to my C# code. Does anybody has a step-by-step explanation how to do it? I am not an expert programmer but I understand the basics.
What I have: a DLL package (files: file.dll, file.lib, file.pdb)
I got the header file and there I can find the functions I want to bind. Theoretically, I should only bind these functions to my C# and then I don't care anymore about the .dll library or C code.
I have tried to solve the problem with: - C++/CLI - PInvoke
But it doesn't work for me.
// these is a part of the code of the header file. And that is all what I have to bind to my C# code.
class EXPORTINGDLL Application
{
void * privatePtr;
protected:
bool master;
public:
Aplication(const char * UartName, bool isMaster);
virtual ~Application();
void Start(); // call only once please!
void Connect();
bool SendFrame (const uint8_t * data, size_t length);
virtual void onConnected() = 0;
virtual void onDisconnected() = 0;
virtual void onDataReceived (const uint8_t * data, size_t length) = 0;
};