Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Extract only selected component-related source from library


This question is answered.


Permlink Replies: 2 - Last Post: Jul 15, 2014 11:20 AM Last Post By: Peter Below
Steve Faleiro

Posts: 77
Registered: 3/11/01
Extract only selected component-related source from library  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 14, 2014 6:52 PM
What techniques exist to extract only a selected component's source from the library in which it was packaged in? The intent is to isolate the component's source for installation as a separate component, thus avoiding installation of the entire library.

For example:
I have the complete TMS VCL library with source code, and I only need the TAdvDBDateTimePicker. How can I extract the required (referenced) Delphi sources needed only to install this component.?

Is there any existing tool to accomplish this task? Would ModelMaker Code Explorer have a feature to accomplish this?

TIA.

--
Steve Faleiro
Gerrit Beuze

Posts: 70
Registered: 10/16/00
Re: Extract only selected component-related source from library
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 15, 2014 12:43 AM   in response to: Steve Faleiro in response to: Steve Faleiro
What techniques exist to extract only a selected component's source from the library in which it was packaged in? The intent is to isolate the component's source for installation as a separate component, thus avoiding installation of the entire library.

For example:
I have the complete TMS VCL library with source code, and I only need the TAdvDBDateTimePicker. How can I extract the required (referenced) Delphi sources needed only to install this component.?

Is there any existing tool to accomplish this task? Would ModelMaker Code Explorer have a feature to accomplish this?

The Unit dependency analyzer build into ModelMaker Code Explorer will show you which
units are referenced by any unit.
http://www.modelmakertools.com/articles/unit-dependencies.html
You can then create a report for the used units and do whatever you wish (create a package?)

Gerrit Beuze
ModelMaker Tools
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: Extract only selected component-related source from library  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jul 15, 2014 11:20 AM   in response to: Steve Faleiro in response to: Steve Faleiro
Steve Faleiro wrote:

What techniques exist to extract only a selected component's source
from the library in which it was packaged in? The intent is to
isolate the component's source for installation as a separate
component, thus avoiding installation of the entire library.

You do this by creating a new design-time package (and you have to
remove the full package the vendor supplied from the IDE's package
list). The package has to require the vendor's run-time package (plus
the stock RTL and VCL packages), and otherwise only needs to contain a
single new unit which exports a procedure named Register (case matters
here!) in its Interface part. In that procedure's implementation you
call RegisterClass (from the system.classes unit) for each of the
components you want to install. You need to name the vendor unit in
which the component is defined in your unit's Uses clause and hope that
this unit is either part of the vendor run-time package (usually the
case) or that you have either source or DCU for the relevant unit.

It can get a bit more complex if the component you want to install
requires custom design-time editors. Those you need to register as well
(add DesignIDE to the requires list of your package), for which you
need to know their class names and the units they are defined in. In
such more complex cases you usually are lost if you did not buy the
3rd-party package with full source code.

Also make sure to read the licence you have been granted for the
component package, to make sure that it does not exclude such
"repackaging".

--
Peter Below (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02