i have this code:
HINSTANCE hComponent = ::LoadLibrary("Component1.dll"); i get this compile error:
Error 1 error C2664: 'LoadLibraryW' : cannot convert parameter 1 from 'const char ' to 'LPCWSTR' c:\Documents and Settings\Administrator\Desktop\Component1\Client1\Client1.cpp 9
so i changed the code:
HINSTANCE hComponent = ::LoadLibrary((LPCWSTR)"Component1.dll"); however GetLastError returns ERROR_MODULE_NOT_FOUND. the dll IS in the exe directory though, so its not the location that is the problem. in addition, if i call LoadLibraryA, the function loads the library successfully.
so why is LoadLibrary((LPCWSTR)"Component1.dll"); failing?