When we use SysUtils.LoadPackage in Delphi, the following procedure will be invoked:
If we are very sure that our .bpl packages has no duplicate unit name, we may safely ignore the call to "CheckForDuplicateUnits" procedure. It should improve the loading speed of your Delphi application that built with runtime packages.
procedure
InitializePackage(Module: HMODULE; AValidatePackage: TValidatePackageProc);type
TPackageLoad =procedure
;var
PackageLoad: TPackageLoad;begin
CheckForDuplicateUnits(Module, AValidatePackage);
@PackageLoad := GetProcAddress(Module,'Initialize'
);//Do not localize
if
Assigned(PackageLoad)then
PackageLoad
else
raise
EPackageError.CreateFmt(sInvalidPackageFile, [GetModuleName(Module)]);end
;
If we are very sure that our .bpl packages has no duplicate unit name, we may safely ignore the call to "CheckForDuplicateUnits" procedure. It should improve the loading speed of your Delphi application that built with runtime packages.
No comments:
Post a Comment