Built on the Win32 platform, of course...</A></STRONG><BR>
<DD>
</DL>
<P>To install the package, just change to the directory in which you
uncompressed it and type the following:</P>
<PRE>
install</PRE>
<P>This will take care of copying the right files to the right
places for use by all your perl scripts.</P>
<P>If you're running the core Perl 5.004 distribution, you can
also build the extension by yourself with the following procedure:</P>
<PRE>
perl Makefile.PL
nmake
nmake install</PRE>
<P>If you are instead running the ActiveWare Perl for Win32 port, the
sources to rebuild the extension are in the <EM>ActiveWare/source</EM> directory.
You should put those files in the following directory:</P>
<PRE>
(perl-src)\ext\Win32\API</PRE>
<P>Where <CODE>(perl-src)</CODE> is the location of your Perl-Win32 source files.</P>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>To use this module put the following line at the beginning of your script:</P>
<PRE>
use Win32::API;</PRE>
<P>You can now use the <CODE>new()</CODE> function of the Win32::API module to create a
new API object (see <A HREF="#importing a function">IMPORTING A FUNCTION</A>) and then invoke the
<CODE>Call()</CODE> method on this object to perform a call to the imported API
(see <A HREF="#calling an imported function">CALLING AN IMPORTED FUNCTION</A>).</P>
<P>
<H2><A NAME="importing a function">IMPORTING A FUNCTION</A></H2>
<P>You can import a function from a Dynamic Link Library (DLL) file with
the <CODE>new()</CODE> function. This will create a Perl object that contains the
reference to that function, which you can later Call().
You need to pass 4 parameters:</P>
<OL>
<LI><STRONG><A NAME="item_The_name_of_the_library_from_which_you_want_to_imp">The name of the library from which you want to import the function.</A></STRONG><BR>
<LI><STRONG><A NAME="item_function">The name of the function (as exported by the library).</A></STRONG><BR>
<LI><STRONG><A NAME="item_The_number_and_types_of_the_arguments_the_function">The number and types of the arguments the function expects as input.</A></STRONG><BR>
<LI><STRONG><A NAME="item_The_type_of_the_value_returned_by_the_function%2E">The type of the value returned by the function.</A></STRONG><BR>
</OL>
<P>To explain better their meaning, let's make an example:
I want to import and call the Win32 API <CODE>GetTempPath()</CODE>.