[翻译]JWA(JEDI Windows API Headers)库的readmefirst.txt文件翻译

JWA库的目的是将Windows的头文件转换为Delphi的调用格式,官方说法如下:

The JWA library aims to provide a conversion from C to Delphi of as many headers as possible from the PSDK etc.

The goal of this project is to provide a conversion of the headers from the Windows Platform SDK which is as complete as only possible.
Most of the code has been donated by Marcel van Brakel. This basically means that this project replaces the old Win32 header conversions of the very same Marcel van Brakel – which was distributed on the JEDI homepage.
Whereever appropriate other headers may be included into the project.

    现在这个JWA库做的真是不错,可以仅引用一个文件就达到对所有函数的声明。

    下面的文字是对 \jwa\branches\2.3\Win32API\readmefirst.txt 的翻译,有不尽之处敬请指出,先谢过。

     

    This is the try to include all converted header files into one unit.

    这次尝试将全部转换的头文件并入一枚单元中。

    PLEASE READ THIS FIRST!

    请一定先读我,拜托!

    Be aware that there are some already created packages in the folder: \trunk\packages
    You can use them in your Delphi version. Older packages can be converted by newer Delphi versions
    so it is not a problem that there are many empty Delphi version folders.
    Just use an old package version with your Delphi and let it recreate then copy it to a folder that describes the version correctly.
    You can help make JWA better by sending us the Delphi version package.

    要知道已经整了几个Package在 \trunk\packages里
    你可以根据Delphi版本直接使用。老的 Package 可以被新版本转换。
    所以弄出不少空的版本文件夹不是问题。
    只需要用个老的 package 版本,再重建,然后拷贝到正确描述的文件夹即可。
    你可以帮忙生成版本 Package 然后发给我们,这样可以使 JWA 更美好。

    You can get a deeper understanding if you continue reading....

    继续读下去你会更清楚。。。

    To compile the bunch of files do these simple steps:

    下面几步就可以编译:

    1. create a package with a name and location of your choice
    2. add the file jwaWindows.pas - and only this file to the package (except jwaVista.pas for Vista structures)
    3. add source path to common files (usually located in a folder named "Common")
    4. Choose between dynamic or static binding by set the compiler switch
    DYNAMIC_LINK or unset it. You can change this in jwaWindows.pas. Open it to edit.
    You can also set WINXXX, where XXX is a Windows version to include or exclude
    functions (un)supported by Windows versions. This is done in includes\jediapilib.inc
    1. 创建一个 package,名称和路径随你
    2. 添加 jwaWindows.pas 文件——只需要这一个文件到 package 里 (只是 jwaVista.pas 用于 Vista 结构)
    3. 将 common 目录添加到工程的 Search 路径中,这里是 \jwa\branches\2.3\Common。
      (事实上还需要将 \jwa\branches\2.3\Win32API 添加到路径中)
    4. 选择编译开关:dynamic 或 static (打开 DYNAMIC_LINK 开关,或关闭之)
      你也可以在 jwaWindows.pas 里面修改它,打开并编辑即可。
      你也可以打开版本开关:WINXXX,XXX是 Windows 版本,由此来控制是否引用支持对应Windows版本的函数。
      这是通过 includes\jediapilib.inc 文件实现的。

    5. Choose an output path for the files that will be created by Delphi. You can change it in the setting/options dialog of the package.
    7. Also set the options optimization and debugger option in the setting page as you want.
    8. Compile the package. It will need its time.
    9. If everything went fine you'll find a file called jwaWindows.dcu (jwaVista.dcu) that you can use in your programs. Remember each delphi version needs its own version of that file.
    You have to repeat the compilation in each delphi version you want to use.
    The advantage is that you can rebuild your project without rebuilding all API files.

    5. 选择 output 路径。可以在 package 的 setting/options 对话框中修改。
    6. 太没6了
    7. 也可以在设置页中配置优化和调试选项
    8. 编译 package,这需要点儿时间。
    9. 如果搞定,你会得到一个文件 jwaWindows.dcu (jwaVista.dcu),你可以在程序里面使用。
      注意每个Delphi版本都需要一个这样的文件。
      你需要对需要使用的每个Delphi版本都重复这样的编译过程。
      好处就是重编你的工程,不需要重编所有的API文件。

    To use jwaWindows.dcu you can copy it in your project folder or
    Add a search path into your project settings. Delphi comes with a global path settings that would be the right choice here.
    You can change it in menu Tools->Environment Options-> tab Library
    -> Library path.

    使用 jwaWindows.dcu 的方法是将其拷贝到工程目录下,或者将其添加到工程的 Search 路径里。
    如果使用 Delphi 的全局路径配置更好。
    IDE主菜单 Tools->Environment Options-> tab Library-> Library path.

    If you also add the source file folder to the debug path in your project/global settings, you can browse the source code without compiling it.

    如果你也将代码目录添加到了工程或全局的调试路径中,不需要编译你也可以浏览代码。

    The includes\jediapilib.inc contains some compiler directives (like WINXP, WINVISTA) that shows or hides function declarations that are only
    available on these plattforms. Make sure you use them wisely. Especially you can prevent your application from starting if you use static
    function binding with these functions. Your app will not start if you use a Vista only function because it is unknown to Windows XP or even 2000.
    Windows 2003 also contains some functions that are not available to Xp. Windows XP contains a known function (WNetRestoreConnectionW) that is no longer available in Windows Vista.

    includes\jediapilib.inc 文件包含了编译开关(如 WINXP, WINVISTA),可以令函数声明仅对指定的平台有效。
    要确保你明智的使用。尤其是从一开始就要避免对这些函数的静态绑定。 如果你用了仅在 Vista 可用的函数,你的程序就没法启动,因为它对 XP甚至2000都不可知。Windows 2003也包含一些XP不可用的函数。已知XP有个函数在Vista下无效(WNetRestoreConnectionW)。

    Using dynamic binding is a safe way to make your applications startable under all Windows versions. However your problem will only be postponed
    to a later failure point. You must make sure that these functions are supported by the operation system where your app is intended to be run.
    The MSDN provides information wich OS supports a particular function.

    使用动态绑定可以让程序在所有的Windows版本下安全工作。但是你的问题不过是延迟到了此后的故障点。你必须确保这些函数在你需要的系统下都能支持。
    MSDN提供了查找某个函数可以支持的操作系统列表。

    Additional information can be found at the mailing list
    http://sourceforge.net/mailarchive/forum.php?thread_name=4759DDA0.7080801%40gmx.de&forum_name=jedi-apilib-wscl

    其他信息可以在邮件列表中找到
    http://sourceforge.net/mailarchive/forum.php?thread_name=4759DDA0.7080801%40gmx.de&forum_name=jedi-apilib-wscl

    Subscribe here:
    http://sourceforge.net/mail/?group_id=121894

    在这里订阅
    http://sourceforge.net/mail/?group_id=121894

    December 2007/2008
    Christian Wimmer (mail(at)delphi-jedi(dot)net)

    Technorati 标签: , ,

    你可能感兴趣的:(windows)