I am trying to call a function within a DLL using Win32::API and am trying to do using Import and prototypes.
The parameters required by the function are all custom types, and so after reading the C header files and Win32::API::Type I have defined these types and Imported the function:
use strict; use Win32::API; Win32::API::Type->typedef( 'OMDTEXTZ', 'TCHAR'); Win32::API::Type->typedef( 'OMDERROR', 'ULONG'); Win32::API::Type->typedef( 'OMD32U', 'ULONG' ); Win32::API::Type->typedef( 'OMDCLIENT', 'ULONG' ); Win32::API->Import( 'omdapi', 'OMDERROR OMDClientCreate ( OMDTEXTZ* pUsername, OMDTEXTZ* pPassword, OMDTEXTZ* pDomain, OMD32U options, OMDCLIENT* pClient )' ); ## my $return = OMDClientCreate( "OMG, I am so confused!" );
My question is: how am I supposed to call OMDClientCreate? When the C function wants a OMDTEXTZ* do I simply give it a Perl string? What about when it wants a OMDCLIENT* to return me the client handle?
I have found little to no documention in either Win32::API or Win32::API::Type to explain how this is done.
Thanks,
fx, Infinity is Colourless
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |