I´m developing an application to hook mouse click using Visual Studio 2005. I´ve created a DLL called bloq_mouse.dll. To create this DLL I wrote an bloq_mouse.h defining the functions to be exportable:
#define DLLEXPORT __declspec(dllexport)
std::vector< std:air< POINT , POINT > > coords;
DLLEXPORT int loadBloqCoords(const char config[_MAX_PATH]);
DLLEXPORT LRESULT CALLBACK mouseHookProc(int nCode, WPARAM wParam, LPARAM lParam);
The DLL seems to load succesfully (I copied it in the executable´s project dir) but when I try to access loadBloqCoords function I get an 127 error (cannot find the proccess).
I´m new with DLL making and accessing, Can Anyone Help Me?
The DLL seems to load succesfully (I copied it in the executable´s project dir) but when I try to access loadBloqCoords function I get an 127 error (cannot find the proccess).
Always check using a utility such as Dependency Walker (depends.exe) or dumpbin to ensure that the actual function name you're trying to get the address of is actually exported using that very same name.
More than likely, the function wasn't exported, or it was exported with a decorated name (not the name you're calling GetProcAddress() with).
I used Dependency walker to see functions names and you were right, the names were decorated. I solved the problem using the decorated name in my GetProcAddress. Tried to put extern "C" in my .h file but the names were still decorated.
I used Dependency walker to see functions names and you were right, the names were decorated. I solved the problem using the decorated name in my GetProcAddress. Tried to put extern "C" in my .h file but the names were still decorated.
See the FAQ, as creating clean, unmangled exported names requires you to do the steps detailed here:
Bookmarks