• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1860
  • Last Modified:

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.
0
ahalya
Asked:
ahalya
  • 11
  • 9
2 Solutions
 
Geert GruwezOracle dbaCommented:
have you ever done in previous versions ?

read this chapter:
http://www.marcocantu.com/ddh/ddh15/ddh15e.htm
0
 
ahalyaAuthor Commented:
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.



0
 
Geert GruwezOracle dbaCommented:
you will not see any new published properties unless you use the RegisterCustomModule
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
ahalyaAuthor Commented:
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 :-)
0
 
Geert GruwezOracle dbaCommented:
it'll take a day or 2, ok ?
little too busy for long answers ...
0
 
ahalyaAuthor Commented:
Sure..
0
 
Geert GruwezOracle dbaCommented:
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
0
 
Geert GruwezOracle dbaCommented:
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 !
0
 
Geert GruwezOracle dbaCommented:
0
 
ahalyaAuthor Commented:
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.

0
 
ahalyaAuthor Commented:
huh, forgot the attachment
tmp001.jpg
0
 
Geert GruwezOracle dbaCommented:
i actually open the package stubs.dproj and then install ...


funny, it works for me.

stubs.png
0
 
ahalyaAuthor Commented:

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 ?)

0
 
Geert GruwezOracle dbaCommented:
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 ?

0
 
ahalyaAuthor Commented:
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 ??
0
 
Geert GruwezOracle dbaCommented:
what delphi version are you using ?
0
 
Geert GruwezOracle dbaCommented:
i mean pro, arch, ent ...
0
 
ahalyaAuthor Commented:
Ok, it appears that the problem is a bug in Delphi when shared repository has a valid path.

See http://qc.embarcadero.com/wc/qcmain.aspx?d=32917

I can add to the repository when I remove the shared repository.

0
 
Geert GruwezOracle dbaCommented:
well, that explains your problem.

i never considered bugs, thought Delphi was free of that ...
guess they aren't that perfect yet
0
 
ahalyaAuthor Commented:
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 :-)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 11
  • 9
Tackle projects and never again get stuck behind a technical roadblock.
Join Now