delphi 2006,自定义组件中的SynTaskDialog编译错误

标签 delphi delphi-7 custom-component delphi-2006

我正在为 delphi 7delphi 2006 开发组件,该组件使用 synopse 中的 SynTaskDialog.pas ,我已经在delphi 7组件中成功使用了SynTaskDialog.pas,但是当我尝试在delphi 2006中使用它来创建组件包时。我收到错误

enter image description here

我在 synopse.info/forum 上找到了相同的解决方案

<小时/>

引用:

我找到了两种解决方法:要么

  1. 用字符串数组替换指针数组,例如
  TD_ICONS_IDENT: array[TTaskDialogIcon] of string =(
    '', SMsgDlgWarning, SMsgDlgConfirm, SMsgDlgError, SMsgDlgInformation,
    '', SMsgDlgInformation);

并删除一些 LoadResString 调用或

2.用类似函数替换指针数组

  GetIconIdent(TTaskDialogIcon): Pointer
<小时/>

但即使在那之后我也无法编译该组件的包。这些错误来了

 [Pascal Error] E2201 Need imported data reference ($G) to access 'SMsgDlgOK' from unit 'SynTaskDialog'
 [Pascal Error] E2201 Need imported data reference ($G) to access 'SMsgDlgYes' from unit 'SynTaskDialog'
 [Pascal Error] E2201 Need imported data reference ($G) to access 'SMsgDlgNo' from unit 'SynTaskDialog'
 [Pascal Error] E2201 Need imported data reference ($G) to access 'SMsgDlgCancel' from unit 'SynTaskDialog'
 [Pascal Error] E2201 Need imported data reference ($G) to access 'SMsgDlgRetry' from unit 'SynTaskDialog'
 [Pascal Error] E2201 Need imported data reference ($G) to access 'SCloseButton' from unit 'SynTaskDialog'

最佳答案

为什么不问项目论坛的问题?

解决方案可以增强此开源单元的官方代码。

好的 - 它可能会帮助我获得一些 SO 积分。 ;)

据我所知,这个“E2001”问题已经被识别 - 请参阅 this post并且应该已修复在最新的主干中。这听起来适用于 Delphi 7,但不适用于 Delphi 2006。

以下是此编译器错误的潜在解决方法:

定义这样一个函数:

function IconMessage(Icon: TTaskDialogIcon): string;
begin
  case Icon of
    tiWarning:   result := SMsgDlgWarning;
    tiQuestion:  result := SMsgDlgConfirm;
    tiError:     result := SMsgDlgError;
    tiInformation, tiShield: result := SMsgDlgInformation;
    else result := '';
  end;
end;

这样使用:

if Inst='' then
  Inst := IconMessage(aDialogIcon);

现在是committed in the project trunk .

感谢您使用我们的开源组件!

关于delphi 2006,自定义组件中的SynTaskDialog编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10510428/

相关文章:

delphi - 在 Delphi 中导入和处理 CSV 文件中的数据

delphi - 在C++ Builder中是否有“字符串列表中的字符串用于字符串”的等效项?

delphi - Delphi的TADOConnection线程安全吗?

delphi - 配置不考虑的区域设置

delphi - TPanel颜色为黑色,无论如何

android - 自定义 View 不膨胀

c# - 自定义组件在设计器中工作,但在代码中不可见

macos - 如何在 Windows 和 OSX 上浏览文件夹?

c# - 引用自定义组件的设计时程序集

delphi - 调用 postmessage 返回 "access denied"