windows 7 - GetProcAddress doesn't work for functions other than void -
i have problem getprocaddress: wrote simple dll 1 function in it:
extern "c" lresult winapi function(hwnd hwnd, uint message, wparam wparam, lparam lparam) { beep(1000, 1000); return callnexthookex(0, message, wparam, lparam); }
when try function's address getprocaddress fails errorcode 127 (error_proc_not_found). however, if use void function type works perfectly. can't figure out why behaves this. suggestions appreciated!
btw: dependencywalker shows function's name indeed "function" no changes have been applied.
there 2 failure modes getprocaddress:
- you didn't export function
- you didn't name right
the exported named of function not "function" unless used .def file rename export or created 64-bit dll. "_function@16" 32-bit build. @16 postfix associated fact have trouble making work functions arguments.
from visual studio command prompt run dumpbin.exe /exports on dll see exports. delete .pdb file in same directory if there one.
Comments
Post a Comment