I'm having the following issue:
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main() {
HANDLE handle;
DWORD dw;
handle = LoadLibrary("C:\\Folder\\mydll.dll");
dw = GetLastError();
printf("Loading Library: %d", dw);
FreeLibrary(handle);
return 0;
}
When compiling this with Netbeans/MinGW, everything works fine, the DLL is loaded and the output is "Loading Library: 0".
But when compiling the exact same code on the exact same machine with Visual C++ 2008 Express, I get the infamous 126 error: "Loading Library: 126".
The DLL is obviously existent at the specified location and loading it works as well - when I'm using Netbeans with MinGW. But why doesn't it work when using Visual C++?
This is only sample code to outline my problem. It's part of a much larger project which works completely fine when compiled with Netbeans/MinGW, but which doesn't load the DLLs when compiled with Visual C++...
Thanks for all answers!