The code:
typedef int (__cdecl* Connectf)(const char*);
Connectf Connect = (Connectf)GetProcAddress(LoadLibrary(L"CCAPI.DLL"),"connectConsole");
shows you how to access the library. The
LoadLibrary
call loads the DLL into memory and the
GetProcAddress
call finds the entry point. However if either of these calls fail then it will not work. You should modify it something like:
typedef int (__cdecl* Connectf)(const char*);
HMODULE hModule = LoadLibrary(L"CCAPI.DLL");
if (hModule == NULL)
{
}
Connectf Connect = (Connectf)GetProcAddress(hModule, L"connectConsole");
if (Connect == NULL)
{
}
Then you will at least have some idea of why it is not working.