I have a DLL which I need to write a wrapper for. The goal is to use it in a C# .NET application so I need to use C++/CLI (never had read about it before, so I'm new to that).
The function header in the dll is the following:
extern "C" __declspec(dllexport) BOOL __stdcall PlayM4_GetPort(LONG* nPort);
The header I've defined in my wrapper is this:
bool PlayM4Wrapper::GetPort(long^ nPort);
From what I've understood, the circunflex sign (^) means that is a pointer to the argument (nPort
). So what I'm trying to write is the following code but I'm getting a conversion error Error C2664 'BOOL (LONG *)': el argumento 1 no puede convertirse de 'System::Int32 ^' a 'LONG *'
.
bool PlayM4Wrapper::GetPort(long^ nPort)
{
BOOL ret =_mLoader->m_PlayM4GetPort(nPort);
return static_cast<BOOL>(ret);
}
Can anyone please help me with this? How should I write this wrapper function?
Thanks.