[英]How to supress Entry Point Not Found error on loading Delphi package?
我維護一個用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
---------------------------
這是例外:
---------------------------
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 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.