|
From: Rodney S. <Rod...@wn...> - 2002-01-03 00:54:04
|
I am trying (w/o success) to use a new W32 API call : SendInput.
Compatibility: NT 4.0(SP3) or later; Win 98 or later; CE Unsupported.
I have NT4.0(SP6). I included the following in my source file (script.c):
/**************************************************************************=
**These API calls are missing from my winuser.h file:**********************=
******************************************************/typedef struct =
tagMOUSEINPUT { DWORD dx; DWORD dy; DWORD mouseData; =
DWORD dwFlags; DWORD time; DWORD dwExtraInfo;} MOUSEINPUT, *LPMOUSEINP=
UT;typedef struct tagKEYBDINPUT { WORD wVk; WORD wScan; =
DWORD dwFlags; DWORD time; DWORD dwExtraInfo;} KEYBDINPUT, =
*LPKEYBDINPUT;#define VK_P 80 /* using vbKeyP =
instead would also work */#define KEYEVENTF_KEYUP 2typedef struct =
tagINPUT_TYPE { DWORD type; union { MOUSEINPUT mi; =
KEYBDINPUT ki; };} INPUT, INPUT_TYPE, *LPINPUT_TYPE;#define INPUT_KEYBOARD=
1#define INPUT_MOUSE 0LRESULT WINAPI SendInput( DWORD =
nInputs, LPINPUT_TYPE pInputs, DWORD cbSize );/****************************=
***************************************************************************=
*************************************************/
I compile like so:
>make
gcc -c -mwindows -mno-cygwin script.c
gcc -o script.exe -mwindows -mno-cygwin script.o script.res -luser32
script.o(.text+0x1ab4):script.c: undefined reference to `SendInput@12'
script.o(.text+0x1c72):script.c: undefined reference to `SendInput@12'
script.o(.text+0x1e37):script.c: undefined reference to `SendInput@12'
script.o(.text+0x1ec9):script.c: undefined reference to `SendInput@12'
collect2: ld returned 1 exit status
make: *** [script.exe] Error 1
If I look into USER32.DLL, SendInput does not have a leading underscore =
and it does not have a "@12" postfix. In fact, none of the USER32.DLL =
functions have an underscore prefix or a "@##" postfix.
I have tried pexorts in all sorts of manners:
>~/bin/pexports.exe /WINNT/system32/USER32.DLL > user32.def
>~/bin/pexports.exe -o /WINNT/system32/USER32.DLL > user32.def
>~/bin/pexports.exe -oh /usr/include/w32api/winuser.h /WINNT/system32/USER3=
2.DLL > user32.def
>~/bin/pexports.exe -h /usr/include/w32api/winuser.h /WINNT/system32/USER32=
.DLL > user32.def
>~/bin/pexports.exe -p "gcc -E -D __attribute__(x)=3D -xc-header -I =
/usr/include/w32api" -h /usr/include/w32api/winuser.h /WINNT/system32/USER3=
2.DLL > user32.def
Each time I run dlltool like so: dlltool -d user32.def -l libuser32.a
For example, if I do:
>~/bin/pexports.exe /WINNT/system32/USER32.DLL > user32.def
(note: user32.def does not have leading "_" or "@##" postfixes and no =
ordinal numbers)
>dlltool -d user32.def -l libuser32.a
(note: libuser32.a declares calls with a leading underscore; eg. =
"_SendInput")
>gcc -o script.exe -mwindows -mno-cygwin script.o script.res ./libuser32.a
(note: script.o expects "_SendInput@12", link with the local libuser32.a)=
The result is still:
script.o(.text+0x1ab4):script.c: undefined reference to `SendInput@12'
script.o(.text+0x1c72):script.c: undefined reference to `SendInput@12'
script.o(.text+0x1e37):script.c: undefined reference to `SendInput@12'
script.o(.text+0x1ec9):script.c: undefined reference to `SendInput@12'
collect2: ld returned 1 exit status
What am I doing wrong? How can I regenerate libraries for the standard =
W32 API dlls? I declared SendInput exactly like the other calls from =
winuser.h.
I am confused and frustrated with M$ crap. Please help.
--=20
Rodney Stromlund (extension: 6484)
Southwest Airlines Co. Dept: Systems
Psalms 37:12-15 (http://bible.gospelcom.net/bible?passage=3Dpsalms+37%3A12-=
15&version=3DNLT)
|