how can i import function by ordinal?
Printable View
how can i import function by ordinal?
The same error i was getting before
Unhandled exeption in app.exe:0xc0000005: Access Violation
Have you tested if the return value is NULL?
Never rely that GetProcAddress will return a valid address.
Use the dependency walker (supplied with VC++) to find out if the dll really exports the function you're searching for.
well i got it working the problem wasn't where i thought it to be.
i had this line
pfunc=(FARPROC (__stdcall *) (HWND, int, int, char*, char*, int))GetProcAddress(GetModuleHandle("SHELL32.DLL"),(char*)(0x3d));
i guess the GetModuleHandle("SHELL32.DLL") was wrong here
(don't know why) but it works this way
pfunc=(FARPROC (__stdcall *) (HWND, int, int, char*, char*, int))GetProcAddress(LoadLibrary("SHELL32.DLL")
char*)(0x3d));