我在Delphi5中使用Printer API—DeviceCapabilities时,发现了一个小小的问题,因为DeviceCapabilities居然不能用,说在动态连接库中找不到,百思不得其解。看SDK帮助中发现该函数的定义如下:
DWORD DeviceCapabilities(    LPCTSTR pDevice, // pointer to a printer-name string 
    LPCTSTR pPort, // pointer to a port-name string 
    WORD fwCapability, // device capability to query 
    LPTSTR pOutput, // pointer to the output 
    CONST DEVMODE *pDevMode  // pointer to structure with device data  
   );
而Delphi5中windows单元中的定义居然是:
function DeviceCapabilities( pDriverName, pDeviceName, pPort: PChar;
  iIndex: Integer; pOutput: PChar; DevMode: PDeviceMode): Integer; stdcall;
faint,居然多了一个pDriverName参数,真是够乱七八糟的。
开始还以为是该API改了实现,后来在C++ Builder和VC帮助中看到的定义与SDK如出一辙才知道,Delphi自己搞错了。