Web lists-archives.org

[Mingw-users] How to use GetProceAddress in Mingw ?




Say this is my code:

#include <stdio.h>
#include < windows.h>

typedef int (__cdecl *MYPROC)(LPWSTR);

int main(
        int argc,
        char *argv[]
) {
    HMODULE hModule;
    MYPROC SendInput;

    if (!(hModule = LoadLibrary(" user32.dll"))) {
        puts("user32.dll not loaded.");
    }
    if (SendInput = (MYPROC)GetProcAddress(hModule, "SendInput")) {
        puts("SendInput is not found.");
    }

    return (0);
}

"SendInput is not found" is always shown in my console...
I know SendInput is in user32.dll, but I just cannot get it with GetProcAddress()!
What I got from "objdump -T user32.dll" is:
....
[Ordinal/Name Pointer] Table
....
[ 570] SendInput
....

Any help is appreciated.
--
This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users