Article View: borland.public.delphi.language.objectpascal
Article #32443Re: What does the package contain
From: Uter [TeamD]
Date: Sat, 23 Nov 2002 03:08
Date: Sat, 23 Nov 2002 03:08
52 lines
2755 bytes
2755 bytes
> procedure GetPackageInfo(Module: HMODULE; Param: Pointer;
> var Flags: Integer; InfoProc: TPackageInfoProc);
I don't have an HModule for the second (failed) bpl. I need to know what's
in it because I can't load it.
This is a very simplified example of what I hope to be able to accomplish...
for i := 0 to FilesFoundNamesStringList.Count - 1 do
begin
try
LoadPackage(FilesFoundNamesStringList[i]);
except
on E: EPackageError do // invalid package
begin
// i wish this next function existed..
// it would take the file name of an unloaded module and
// it would return something useful to
// be used in the next function
APackageInfoRecord :=
GetExportedStuffFromPackage(FilesFoundNamesStringList[i]);
// this would take the info record and iterate the
// list of loaded modules to find a matching one
if
FindSimilarModuleAndDecideWhichIsOlderAndLoadTheNewOne(APacakgeInfoRecord)
then
RenameFile(FilesFoundNamesStringList[i],
FilesFoundNamesStringList[i] + '.InvalidPackageFile');
end
else // package intialization failed
begin
E.Message := 'Module initialization failed: ' +
FilesFoundNamesStringList[i]
' with message: ' + E.Message
end;
end;
end;
> There are many other package functions in there that may be of use to
> you.
> Also, enter "packages" into the Delphi Help. :)
Such abuse! I'm deeply hurt. <g>
I've already looked at the package functions thank you very much. :)
I know something like this must be possible because I can view the exports
with tdump or QuickView.
--
Mark Lauter
Technical Details
Message-ID:
<3ddef233@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-01!sn-xit-08!supernews.com!38.144.126.76.MISMATCH!feed2.newsreader.com!newsreader.com!newsfeed.media.kyoto-u.ac.jp!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mailReferences:
<3ddece43$1@newsgroups.borland.com> <3dded94e$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109d30,7385ecc87b03ad2c X-Google-Attributes: gid109d30,public X-Google-ArrivalTime: 2002-11-22 19:15:53 PST From: "Uter [TeamD]" <marklauter@hotmail.com> Newsgroups: borland.public.delphi.language.objectpascal References: <3ddece43$1@newsgroups.borland.com> <3dded94e$1@newsgroups.borland.com> Subject: Re: What does the package contain Date: Fri, 22 Nov 2002 22:08:13 -0500 Lines: 54 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 65.34.85.56 Message-ID: <3ddef233@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1038021171 65.34.85.56 (22 Nov 2002 19:12:51 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-01!sn-xit-08!supernews.com!38.144.126.76.MISMATCH!feed2.newsreader.com!newsreader.com!newsfeed.media.kyoto-u.ac.jp!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!news.uni-x.net!newsgroups.borland.com!not-for-mail