How to fix Entry Point Not Found error while downloading Delphi package?

I support a program written in Delphi 6. It downloads some bpl package files dynamically using SysUtils.LoadPackage. Often I change something in a program that causes the package to not load. When this happens, a message box appears, and then an exception is thrown. The message field and the exception are separate.

Here is an example message box:

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

And here is the 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 --------------------------- 

I do not see how to stop the message box from appearing. Any ideas are greatly appreciated.

+4
source share
1 answer

Solved!

I made a copy of SysUtils.LoadPackage in my application and edited this copy to pass the second parameter to SafeLoadLibrary.

So, calling SafeLoadLibrary now looks like this:

 Result := SafeLoadLibrary(Name, SEM_FAILCRITICALERRORS); 

This helped: http://msdn.microsoft.com/en-us/library/ms680621%28VS.85%29.aspx .

+3
source

All Articles