【问题标题】:PowerBuilder 2021 Deployed user32.dll ErrorPowerBuilder 2021 部署的 user32.dll 错误
【发布时间】:2021-10-12 01:16:14
【问题描述】:

我已部署 PowerBuilder 2021 build 1288,当访问日历下拉列表时,应用程序崩溃并显示此 error

Error Number 21
Error text = Bad runtime function reference at line 43 in function of of_iscalendaropen of object u_dw_dsa_detail
Object = u_dw_dsa_detail
Control = u_dw_dsa_detail
Script = of_iscalendaropen
Line in script = 43

我的代码中有这两个函数,它们调用 user32.dll,这是错误消息所指向的直接位置。我在部署的工作区中有一个 user32.dll 的副本,由于某种原因,错误仍在发生 - 其他 .dll 似乎工作正常。

FUNCTION ulong win_GetFocus() ALIAS FOR "GetFocus" LIBRARY "user32.dll"
FUNCTION ulong win_GetClassName(ulong hwnd, ref string cname, int buf) ALIAS FOR "GetClassNameW" LIBRARY "user32.dll"

【问题讨论】:

  • 您不应该分发 User32.dll。它是一个系统 DLL,是 Windows 操作系统的一部分,不应位于 Windows 文件夹之外的任何位置。您应该使用已经在每个启动过的 Windows 系统上的那个。
  • 该方法的第 43 行是由什么组成的? (如错误消息中所述)
  • 请将错误作为文本而不是屏幕截图添加到您的问题中。

标签: powerbuilder


【解决方案1】:

许多 Windows 调用都需要 ANSI 参数。

PowerBuilder 的现代版本使用 Unicode 字符编码。

我建议你试试

FUNCTION ulong win_GetFocus() ALIAS FOR "GetFocus" LIBRARY "user32.dll;ansi"

如果可行,请告诉我们!

另外,第 43 行的代码会非常有用。

由于您使用的是自己的 user32.dll 版本,它可能与 Windows 版本不兼容。这将导致您的应用程序失败。此外,如果您的 user32.dll 版本太旧,它将没有 GetClassNameW,这会导致您的应用程序失败。

【讨论】:

    猜你喜欢
    • 2012-03-23
    • 1970-01-01
    • 2013-04-17
    • 2011-11-30
    • 2011-11-16
    • 1970-01-01
    • 1970-01-01
    • 2012-02-01
    • 2013-01-21
    相关资源
    最近更新 更多