代码之家  ›  专栏  ›  技术社区  ›  cja

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

  •  4
  • cja  · 技术社区  · 14 年前

    以下是消息框的示例:

    ---------------------------
    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   
    ---------------------------
    

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

    1 回复  |  直到 14 年前
        1
  •  3
  •   cja    13 年前

    解决了的!

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

    所以对SafeLoadLibrary的调用现在看起来像:

    Result := SafeLoadLibrary(Name, SEM_FAILCRITICALERRORS);
    

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