Okay... I've been reading the perl api documentation. I am now slightly less
less clueless.
From: Garrett Goebel [mailto:[EMAIL PROTECTED]]
>
> I'm trying to wrap the Win32 user32.dll function
What I'd like to be able to do, is to wrap a Win32 API call, allowing the
external function to fill in the string slot of the scalar paramater.
> UINT RealGetWindowClassA(
> HWND hwnd, // handle to window
> LPTSTR pszType, // window type buffer
> UINT cchType // size of window type buffer
> );
>
>
> Working with my extremely limited knowledge of C... and Perl
> internals... I came up with this:
int Get_Window_Class(long hWnd, SV* class) {
return RealGetWindowClassA(hWnd, SvPV_force(class, PL_na), SvCUR(class));
}
The compile fails with:
main_C_test_pl_035e81e993b9a22c450568ba1f1b7cc5.obj : error LNK2001:
unresolved external symbol _RealGetWindowClassA
blib\arch\auto\main_C_test_pl_035e81e993b9a22c450568ba1f1b7cc5\main_C_test_p
l_035e81e993b9a22c450568ba1f1b7cc5.dll : fatal error LNK1120: 1 unresolved
externals
NMAKE : fatal error U1077: 'link' : return code '0x460'
Stop.
"RealGetWindowClassA" is a function exported by User32.dll. I recall reading
in the Inline documentation something about Inline creating/using a leading
underscore... but I don't recall what.
The rational visual test "basic" external function declaration which I've
modelled this after:
declare function RealGetWindowClass%
lib "user32.dll" alias "RealGetWindowClassA"
(hWnd&, class$, size%)
works without problem. So I know I can access this user32 function from
other non-C environments... but have no idea why Inline gets an unresolved
external error.
I realize this may be a pedantic C ignoramous question... What can I say?
It is time to start working through the K&R book again. Any ideas? Please
help.
thank you...