Board index » delphi » Adding A New Component

Adding A New Component

I need guidance in how to install a new component from a .pas file into
Delphi 3.

        In response to my need to modify the Delphi grid, someone in the
newsgroup sent me a unit with a subclassed DBGrid DBOGrid.Pas. This unit
appears to be exactly like the example units in the Marco Cantu book (
ie it appears to be a correct unit ).

        I tried to use the component menu to install this new component into an
existing package ( the component was to be installed in the DB Controls
page ).

        The unit re-compiled. However, the new control never appeared. I didn't
specifically assign it an icon if that makes a difference. Can anybody
tell me what I've done wrong ???

Thank you.

Neil Huhta

 

Re:Adding A New Component


nhuhta <nhu...@digital.net> wrote in article <3491DA9D....@digital.net>...

Quote
>    The unit re-compiled. However, the new control never appeared. I didn't
> specifically assign it an icon if that makes a difference. Can anybody
> tell me what I've done wrong ???

For a component to appear on the palette, it need to be registered. Your
unit should include a procedure called "Register". In it, register the
component using RegisterComponents. You can find detailed information in
the help files.
--
Yorai Aminov
El-On Software Systems
http://ourworld.compuserve.com/homepages/yaminov

Re:Adding A New Component


Neil,

Does the PAS file contain a call to RegisterComponent?

Nick Hodges
TeamB

Other Threads