将 DeDe 常量转换为有效声明或其他接口提取工具?

发布于 2024-09-02 22:12:51 字数 489 浏览 2 评论 0原文

我正在使用 DeDe 创建一个可以编译的 API(接口)。 (完全合法:当我们等待供应商在两个月内提供 D2010 版本时,我们至少可以编译我们的应用程序...)

我们将删除所有方法。

Dede 发出如下常量声明:

  LTIMGLISTCLASS = 
    00: ÿÿÿÿ....LEADIMGL|FF FF FF FF 0D 00 00 00 4C 45 41 44 49 4D 47 4C|
    10: IST32.          |49 53 54 33 32 00|;

  DS_PREFIX = 
    0: ÿÿÿÿ....DICM.|FF FF FF FF 04 00 00 00 44 49 43 4D 00|;

如何将它们转换为可编译语句?

理论上,我不关心实际值,因为我怀疑它们在任何地方都可以使用,但我想让它们的大小正确。这些是整数、LongInts 还是 ???

关于使用 DeDe 的任何其他提示都将受到欢迎。

I am using DeDe to create an API (Interface) I can compile to. (Strictly legit: while we wait for the vendor to deliver a D2010 version in two months, we can at least get our app compiling...)

We'll stub out all methods.

Dede emits constant declarations like these:

  LTIMGLISTCLASS = 
    00: ÿÿÿÿ....LEADIMGL|FF FF FF FF 0D 00 00 00 4C 45 41 44 49 4D 47 4C|
    10: IST32.          |49 53 54 33 32 00|;

  DS_PREFIX = 
    0: ÿÿÿÿ....DICM.|FF FF FF FF 04 00 00 00 44 49 43 4D 00|;

How would I convert these into a compilable statement?

In theory, I don't care about the actual values, since I doubt they're use anywhere, but I'd like to get their size correct. Are these integers, LongInts or ???

Any other hints on using DeDe would be welcome.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野却迷人 2024-09-09 22:12:51

这些是字符串。前四个字节是引用计数,对于字符串文字始终为 -1 ($ffffffff)。接下来的四个字节是字符计数。然后是字符空终止符。

const
  LTIMGLISTCLASS = 'LEADIMGLIST32'; // 13 = $0D characters
  DS_PREFIX = 'DICM'; // 4 = $04 characters

您不必“怀疑”这些常量是否在任何地方使用。您可以凭经验确认。编译您的项目时不要使用这些常量。如果编译成功,则不会使用它们。

如果您的项目无法编译,则必须在代码中的某个位置使用这些常量。根据上下文,您可以提供自己的声明。如果常量像字符串一样使用,则声明一个字符串;如果它像整数一样使用,则声明一个整数。

另一种选择是在与您拥有的 DCU 兼容的 Delphi 版本中加载您的项目。使用代码完成功能使 IDE 显示常量及其类型。

Those are strings. The first four bytes are the reference count, which for string literals is always -1 ($ffffffff). The next four bytes are the character count. Then comes the characters an a null terminator.

const
  LTIMGLISTCLASS = 'LEADIMGLIST32'; // 13 = $0D characters
  DS_PREFIX = 'DICM'; // 4 = $04 characters

You don't have to "doubt" whether those constants are used anywhere. You can confirm it empirically. Compile your project without those constants. If it compiles, then they're not used.

If your project doesn't compile, then those constants must be used somewhere in your code. Based on the context, you can provide your own declarations. If the constant is used like a string, then declare a string; if it's used like an integer, then declare an integer.

Another option is to load your project in a version of Delphi that's compatible with the DCUs you have. Use code completion to make the IDE display the constant and its type.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文