Link to home
Start Free TrialLog in
Avatar of ahalya
ahalyaFlag for Canada

asked on

Adding a Form to Delphi 2007 Object Repository

I have gone thorough the process of adding a Form (or a project) to the object Repository in D2007 (have tried both Project -> Add to Object Repository, and right click on the form and  -> Add to Object Repository).

I name them, give a description, select an icon and hit the OK button. It seems to work fine when doing it, but the added form never shows up in the object repository when I click File -> New -> Other.  (During the Add to Object Repository, I could even create a new Category. But the new category is not visible when selecting file -> New).

I want to place a custom form I have created (with new published properties) and have all my form derive from it, instead of the TForm.

What am I missing ?  Your help would be appreciated.
Avatar of Geert G
Geert G
Flag of Belgium image

have you ever done in previous versions ?

read this chapter:
http://www.marcocantu.com/ddh/ddh15/ddh15e.htm
Avatar of ahalya

ASKER

I have added things to the object repository in the Delphi 4 version.  It looked quite different those days, if I recall right.

I have seen Marco Cantu's article that you have cited. It speaks about registering a module. but can't I add something to the repository (without worrying about registering), if I am looking to just inherit from it.



you will not see any new published properties unless you use the RegisterCustomModule
Avatar of ahalya

ASKER

Ok, I understand.

Can you provide a working code.  When I tried to use the snippets in Marco Cantu's page, I run into an error of "proxies.dcu" not found (and I don't have that file in my system).

I've increased the points :-)
it'll take a day or 2, ok ?
little too busy for long answers ...
Avatar of ahalya

ASKER

Sure..
there is one more thing ...

if you want new published properties and visual components on the inherited form
2 steps are needed.
First adding the published properties to a form (inherited from TForm) (let's call this stub form)
Registering with RegisterCustomModule
in a designtime package
and adding it to the repository

Next create a new form, inherited from the stub form, using the repository (let's call this base form)
add components to the base form
then right click add to repository

Next create a new form, inherited from the base form, now you have components and published properties in the property editor
hmm, EE stuff didn't update this Q,
i wonder which one ...

but here is a link to a package and project
first install the package, and add the form to the repository
next open the base form, add to repository

next open the project ... and see the inspector !
SOLUTION
Avatar of Geert G
Geert G
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ahalya

ASKER

Thanks for the files.  If I try to execute your Whoopie.exe I get an error saying "Error reading frmWhoopie.TestA:Property TestA does not exist".  .

Tried the following with your source.

1. Compiled and Installed the packsStubsD.bpl File (via "Components" -> "Install Packages" menu item).  Installed package shows in the list. That's good.

2. Added the form to the repository (Tried both right click on from and "Add to Repository", and  "Project" -> "Add To Repository").  Everything seems OK (see attached JPG). but when I go to "File" -> "New" -> "Other" , I do not see the newly added StubForm. Not Good, I suppose.

Avatar of ahalya

ASKER

huh, forgot the attachment
tmp001.jpg
i actually open the package stubs.dproj and then install ...


funny, it works for me.

stubs.png
Avatar of ahalya

ASKER


Can you clarify whether the only thing you do is to install by right-clicking as shown in your PNG.  

I have tried that as well.  Still do not see StubForm in  File -> New -> Other.

(In an earlier post you said: "first install the package, and add the form to the repository" -I think I am still missing the second part, am I ?)

i'll try and explain the steps in detail:

create new package
set design time only package in properties
add new form unit (stubs)
added properties to stubs in code
add new reg unit (stubsreg)
add procedure Register
add vcldesigner lib to package (from $delphi\lib)
add uses designintf, designeditors, stubs
fill in register proc
save package
compile package
install package

open stubs form in editor
right click, add to repository

create new project
add new form unit, (select stubs form from repository)

are you getting this far ?

Avatar of ahalya

ASKER

Geert,

I get your steps. but the problem in that I cannot add anything to the Object Repository.

I tried to add a simple form -no published properties at all- using "Add to Repository", but it doesn't show.  I think the problem is in getting the form to show in the repository ??
what delphi version are you using ?
i mean pro, arch, ent ...
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
well, that explains your problem.

i never considered bugs, thought Delphi was free of that ...
guess they aren't that perfect yet
Avatar of ahalya

ASKER

A pity that this error was reported in 2006 August at Quality Central, and still is unresolved.  No wonder Delphi isn't gaining any ground :-)