许可优化
许可优化
产品
产品
解决方案
解决方案
服务支持
服务支持
关于
关于
软件库
当前位置:服务支持 >  软件文章 >  Borland Delphi 7的几个错误

Borland Delphi 7的几个错误

阅读数 3
点赞 0
article_banner

星期六编程发现了Borland delphi7的几个错误。

1 在win32 api中有如下一个函数:

The ExtractIconEx function retrieves the handle of an icon from the specified executable file, dynamic-link library (DLL), or icon file.

HICON ExtractIconEx(

   LPCSTR lpszFile,  

   int nIconIndex,    

   HICON FAR * phiconLarge,  

   HICON FAR * phiconSmall,  

   UINT nIcons    

  );      

Parameters

lpszFile

Pointer to a null-terminated string specifying the name of an executable file, DLL, or icon file.

nIconIndex

Specifies the index of the icon to retrieve. If this value is 0, the function returns the handle of the first icon in the specified file. If this value is -1 and phIconLargeand phiconSmall are both NULL, the function returns the total number of icons in the specified file.

phiconLarge

Pointer to an array of handles of large icons returned. This parameter can be NULL.

phiconSmall

Pointer to an array of handles of small icons returned. This parameter can be NULL.

nIcons

Specifies the count of the number of icons to extract.

Return Values

If the function succeeds, the return value is the handle to an icon. If the file specified was not an executable file, DLL, or icon file, the return value is 1. If no icons were found in the file, the return value is NULL.

在Borland delphi7的shellapi.Pas文件中却声明成这样:

{$EXTERNALSYM ExtractIconEx}

function ExtractIconEx(lpszFile: PChar; nIconIndex: Integer;

 var phiconLarge, phiconSmall: HICON; nIcons: UINT): UINT; stdcall;

原型是HICON指针,Borland直接声明成HICON。

如要使用这个函数只好重新声明。

给大家一个声明的例子:

type ThIconArray = array[0..0] of hIcon;
type PhIconArray = ^ThIconArray;

function ExtractIconEx(lpszFile: PAnsiChar;
                       nIconIndex: Integer;
                       phiconLarge : PhIconArray;
                       phiconSmall: PhIconArray;
                       nIcons: UINT): UINT; stdcall;
  external 'shell32.dll' name 'ExtractIconEx';

2Delphi7 sdk帮助里的这个函数也有问题:

The ExtractIcon function retrieves the handle of an icon from the specified executable file, dynamic-link library (DLL), or icon file.

HICON ExtractIcon(

   HINSTANCE hInst,    // instance handle

   LPCTSTR lpszExeFileName,     // filename of file with icon

   UINT nIconIndex        // index of icon to extract

  );      

Parameters

hInst

Identifies the instance of the application calling the function.

lpszExeFileName

Points to a null-terminated string specifying the name of an executable file, DLL, or icon file.

nIconIndex

Specifies the index of the icon to retrieve. If this value is 0, the function returns the handle of the first icon in the specified file. If this value is -1, the function returns the total number of icons in the specified file.

Return Values

If the function succeeds, the return value is the handle to an icon. If the file specified was not an executable file, DLL, or icon file, the return is 1. If no icons were found in the file, the return value is NULL.

NIconIndex为UNIT型不能取负,注释却说“If this value is -1, the function returns the total number of icons in the specified file.”但返回值却没有提到可以返回 “the total number of icons in the specified file”。实际使用中确实也不能取-1,不过好想delphi5中可以这样用。Borland的文档真是叫人受不了。

3Delphi7中公布了alphablend这个属性,可以在2000以上中实现窗体透明,但在98中不行。如果在98中用alphablend这个win32 api函数自己实现窗体透明,编译器又会报错(和属性同名肯定会啦)。


免责声明:本文系网络转载或改编,未找到原创作者,版权归原作者所有。如涉及版权,请联系删

相关文章
QR Code
微信扫一扫,欢迎咨询~
customer

online

联系我们
武汉格发信息技术有限公司
湖北省武汉市经开区科技园西路6号103孵化器
电话:155-2731-8020 座机:027-59821821
邮件:tanzw@gofarlic.com
Copyright © 2023 Gofarsoft Co.,Ltd. 保留所有权利
遇到许可问题?该如何解决!?
评估许可证实际采购量? 
不清楚软件许可证使用数据? 
收到软件厂商律师函!?  
想要少购买点许可证,节省费用? 
收到软件厂商侵权通告!?  
有正版license,但许可证不够用,需要新购? 
联系方式 board-phone 155-2731-8020
close1
预留信息,一起解决您的问题
* 姓名:
* 手机:

* 公司名称:

姓名不为空

姓名不为空

姓名不为空
手机不正确

手机不正确

手机不正确
公司不为空

公司不为空

公司不为空