I'm can't use the function of a dll in delphi. I'm having some problems with the conversions of types.
This is the function I want to call the Delphi DLL:
function SyncFunc(var Type:string; var MaxUsers:integer; var ErrCode :Word):boolean;
C++ code:
unsigned char(WINAPI *SyncFunc)(PCHAR Type, INT *MaxUsers, WORD *ErrCode);
HMODULE hLib;
BOOL Res = FALSE;
WORD ErrCode = 0;
INT MaxUsers = 0;
CHAR Type[256];
hLib = LoadLibrary("delphi.dll");
Res = SyncFunc(Type, &MaxUsers, &ErrCode);
Someone please help. P.S. similar question here C++ consuming delphi DLL (but my function uses string, not WideString)