views:

961

answers:

4

Is there a way to list what units/classes are in a Delphi compiled package?

A: 

Besides asking the developer or reading the documentation, the answer is No.

Robert MacLean
+2  A: 

Have you had a look at the TDUMP utility that is shipped with Delphi 7? A bpl is just a fancy DLL so you can list its exported functions:

e.g.

"C:\Program Files\Borland\Delphi7\Bin\TDUMP.EXE" AFWRTL_RD7.bpl

Turbo Dump Version 5.0.16.12 Copyright (c) 1988, 2000 Inprise Corporation

              Display of File AFWRTL_RD7.BPL

. . .

Exports from AFWRTL_RD7.bpl

91 exported name(s), 91 export addresse(s). Ordinal base is 1.

...

000046B4   31 000A __fastcall Fgint::Base2StringToFGInt(System::AnsiString, Fgint::TFGInt&)

...

If you look at the exported functions, the name of the function seems to be prefixed with the unit or dependent package name, e.g. Fgint::Base2StringToFGInt is function Base2StringToFGInt in unit Fgint.pas.

Alternatively, have a look at the depends.exe utility that ships with the Windows Resource Kit. This provides a GUI to view the contents of a DLL (or BPL).

See

http://www.microsoft.com/downloads/details.aspx?FamilyID=49ae8576-9bb9-4126-9761-ba8011fabf38&displaylang=en

for more details.

Vince

Thanks I did consider TDump until I realised that it's a DCP i want to peek into not a BPL. Unfortunately I do not have the BPL. +1 for the suggestion anyway!
Ben Daniel
+1  A: 

You could create a new package, add your .dcp to its requires clause, add a new unit to it and use code completion in the uses clause - it will show you all available units in all required packages. If your .dcp is the only required package and you set it to display sorted by scope (right-click in the dropdown) then the units from your .dcp should be on top.

I'm not sure if this works in Delphi 7 already. It works in Delphi 2007.

TOndrej
Unfortunately this doesn't actually work in Delphi 7, but I'm making this the accepted answer anyway because it at least works in newer versions. Thanks.
Ben Daniel
A: 

JCL "uses expert" can show a lot right in the IDE.

dmajkic