Hello C Programmers,
I'm trying to call a Dll from a C++ project that should be compliled into a Dll.
Code:
// DLL handle
HINSTANCE DLLHandle = NULL;
Code:
unsigned char CANdoInitialise(void)
{
unsigned char Status;
HINSTANCE DLLHandle = NULL;
if (DLLHandle == NULL)
DLLHandle = LoadLibrary(("CANdo.dll"));
if (DLLHandle != NULL)
{
// DLL loaded, so map functions
if (CANdoMapFunctionPointers())
{
// One or more functions not mapped correctly, so deallocate all resources
CANdoFinalise();
Status = FALSE; // Error
}
else
Status = TRUE; // OK
}
else
Status = FALSE; // Error
return Status;
}
when i try to compile it it get the following error.
Code:
c:\users\mhhansen.dse\documents\visual studio 2008\projects\cando dll driver\cando dll driver\cando dll driver.cpp(101) : error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'const char [10]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
i have tried to search for this probleme using google, but can't seem to find a solution for the probleme.
/Marck Hansen