Menu
  • HOME
  • TAGS

GetProcAddress returning NULL

dll,windows-ce,getprocaddress

Yes, that's a common pitfall. If you don't provide a full path for the DLL, LoadLibrary will return a handle to an already loaded DLL of the same name. From MSDN: If lpFileName does not include a path and there is more than one loaded module with the same base...

Creating a DLL in C++ to import C++ DLL in VS 2005

c++,dll,dllimport,getprocaddress

Look at the DLL's actual exports, such as with a reporting tool like TDUMP or similar. The function you are looking for is not being exported as "RemoveAllDataFile" like you are expecting. It is actually being exported like "_RemoveAllDataFile" instead, or even something like "[email protected]". If you are compiling the...

Invalid conversion from HANDLE to HINSTANCE (Getting a kernel function's address)

c++,windows,kernel32,getprocaddress

This is how you should do it: #include <windows.h> #include <iostream> int main(int argc, char* argv[]) { HMODULE kernel32 = GetModuleHandleA("kernel32"); FARPROC *funcAddr = (FARPROC *)GetProcAddress(kernel32, "SetProcessDEPPolicy"); std::cout << "@" << funcAddr; } ...