Win32::API::Prototype

在Windows 要装这个模组:

ppm install http://www.roth.net/perl/packages/win32-api-prototype.ppd

但是公司不行直接这样安装,所以下载这个win32-api-prototype.ppd,然后修改如下:

<SOFTPKG NAME="Win32-API-Prototype" VERSION="0,2002,12,17">
<TITLE>
Win32::API::Prototype
</TITLE>
<ABSTRACT>
The Win32::API::Prototype module.
Simplifies using Win32::API by accepting a C function prototype
and exposing the function by name in the main namespace.</ABSTRACT>
<AUTHOR>
Roth Consulting (http://www.roth.net/)
</AUTHOR>
<IMPLEMENTATION>
<!-- Perl Version="5005" -->
<OS NAME="MSWin32" />
<ARCHITECTURE NAME="MSWin32-x86" />
<DEPENDENCY NAME="Win32-API" VERSION="0,0,0,0" />
<CODEBASE HREF="http://www.roth.net/perl/packages/lib/Win32/API/Win32-API-Prototype_AllBuilds.tar.gz" />
</IMPLEMENTATION>

注意这个http://www.roth.net/perl/packages/lib/Win32/API/Win32-API-Prototype_AllBuilds.tar.gz

<IMPLEMENTATION>
<!– Perl Version=”5005_AS” –>
<OS NAME=”MSWin32″ />
<ARCHITECTURE NAME=”MSWin32-x86-object” />
<DEPENDENCY NAME=”Win32-API” VERSION=”0,0,0,0″ />
<CODEBASE HREF=”http://www.roth.net/perl/packages/lib/Win32/API/Win32-API-Prototype_AllBuilds.tar.gz” />
</IMPLEMENTATION>

<IMPLEMENTATION>
<!– Perl Version=”5006″ –>
<OS NAME=”MSWin32″ />
<ARCHITECTURE NAME=”MSWin32-x86-multi-thread” />
<DEPENDENCY NAME=”Win32-API” VERSION=”0,0,0,0″ />
<CODEBASE HREF=”http://www.roth.net/perl/packages/lib/Win32/API/Win32-API-Prototype_AllBuilds.tar.gz” />
</IMPLEMENTATION>

<IMPLEMENTATION>
<!– Perl Version=”5008″ –>
<OS NAME=”MSWin32″ />
<ARCHITECTURE NAME=”MSWin32-x86-multi-thread-5.8″ />
<DEPENDENCY NAME=”Win32-API” VERSION=”0,0,0,0″ />
<CODEBASE HREF=”Win32-API-Prototype_AllBuilds.tar.gz” />
</IMPLEMENTATION>
<IMPLEMENTATION>
<!– Perl Version=”5010″ –>
<OS NAME=”MSWin32″ />
<ARCHITECTURE NAME=”MSWin32-x86-multi-thread-5.10″ />
<DEPENDENCY NAME=”Win32-API” VERSION=”0,0,0,0″ />
<CODEBASE HREF=”Win32-API-Prototype_AllBuilds.tar.gz” />
</IMPLEMENTATION>
</SOFTPKG>

注意到这个ppd会使用到http://www.roth.net/perl/packages/lib/Win32/API/Win32-API-Prototype_AllBuilds.tar.gz,所以我们可以自行下载到跟ppd档同一个资料夹中,又因为我使用perl 5.10.0所以要新增这一段叙述:

 <IMPLEMENTATION>
  <!– Perl Version=”5010″ –>
  <OS NAME=”MSWin32″ />
  <ARCHITECTURE NAME=”MSWin32-x86-multi-thread-5.10″ />
  <DEPENDENCY NAME=”Win32-API” VERSION=”0,0,0,0″ />
  <CODEBASE HREF=”Win32-API-Prototype_AllBuilds.tar.gz” />
 </IMPLEMENTATION>

不然会产生ppm install failed: The PPD does not provide code to install for this platform这样的错误!