gpt4 book ai didi

delphi - 如何抑制加载 Delphi 包时出现入口点未找到错误?

转载 作者:行者123 更新时间:2023-12-03 15:31:28 24 4
gpt4 key购买 nike

我维护一个用 Delphi 6 编写的程序。它使用 SysUtils.LoadPackage 动态加载一些 bpl 包文件。我经常更改程序中的某些内容,从而导致程序包无法加载。发生这种情况时,会出现一个消息框,然后引发异常。消息框和异常是分开的。

这是消息框的示例:

---------------------------
Connect Manager: ConnectManager.exe - Entry Point Not Found
---------------------------
The procedure entry point @Connectmanagerplugin@TConnectManagerPluginClassList@UnRegister$qqrp17System@TMetaClass could not be located in the dynamic link library ConnectManagerPack.bpl.
---------------------------
OK
---------------------------

这是一个异常(exception):

---------------------------
Debugger Exception Notification
---------------------------
Project ConnectManager.exe raised exception class EPackageError with message 'Can't load package Projects.bpl.
The specified procedure could not be found'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------

我不知道如何阻止消息框的出现。任何想法都感激地接受。

最佳答案

解决了!

我在应用程序中创建了 SysUtils.LoadPackage 的副本,并编辑了该副本以将第二个参数传递给 SafeLoadLibrary。

因此对 SafeLoadLibrary 的调用现在如下所示:

Result := SafeLoadLibrary(Name, SEM_FAILCRITICALERRORS);

这有帮助:http://msdn.microsoft.com/en-us/library/ms680621%28VS.85%29.aspx .

关于delphi - 如何抑制加载 Delphi 包时出现入口点未找到错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3352603/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com