Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to Delphi

Status
Not open for further replies.

rubirich

Technical User
Dec 17, 2006
6
US
I'm new to Delphi, so please forgive what may well be stupid questions.

I've inherited a project that was originally written in Delphi 7.

The project file is called promain.dpr, but I believe that the main file is unMain.pas with a corresponding form unMain.dfm, which is the main form. The project builds and runs perfectly, but when I try to edit the project in the Visual Editor I run into two serious problems.

1. I get an error message saying Class TGauge not found.
The file unMain.pas contains GAUGES on the USES list,
and I thought that would allow having a TGaugue object in the code.

Also, it was my understanding that the TGauge object is built-in to Delphi, rather than a class defined in the project's source code.

Despite the error, as I mentioned, the project compiles and executes perfectly, including the progress gauge, which I assume is a TGauge object derived from GAUGES.

2. Even more perplexing. In the Designer, I when I try to bring up the main form (i.e. unMain.dfm) in the visual editor, it doesn't come up. Pressing F12 does nothing.

With ALL of the other files that have DFMs in this project, pressing F12 brings up the form, just not the main form.

I'm having both of these problems with other projects that I've inherited and they are threatening my sanity, so I would greatly appreciate any help.

Thank you guys.
 
Also, it was my understanding that the TGauge object is built-in to Delphi, rather than a class defined in the project's source code.

It really isn't "built-in" to Delphi, but it is from an associated unit (Gauges) that comes with Delphi. Anyway to your problems:

get an error message saying Class TGauge not found.

Since the program compiles, obviously this is not a coding problem. It's an editor problem, and perhaps the registration of this particular component got borked somehow. Try looking under your components menu and see if you can locate the particular control. Perhaps a better start for you, though, is to create a new project and find the gauge control and add it to a form (it's under "samples" in Delphi 3). If you can't find it on the menu then it is not likely registered. As you noticed, this won't threaten you being able to do your current project, but it might not hurt to try and fix it if you need TGauge in the future.

Even more perplexing. In the Designer, I when I try to bring up the main form (i.e. unMain.dfm) in the visual editor, it doesn't come up. Pressing F12 does nothing.

For what I have noticed, it tends to do whatever it thinks you want between project runs. I've had the editor bring up my main form, another form, or nothing at all. Bring up the Project Manager option (under "view"), and then select the particular form you want and then it should come up.
 
Thank you.

The main form doesn't come up, but could this be because
some of the components referenced in the form are not registered?

I took your advised and started a new project and sure enough TGauge was not listed among the available controls.

I did find gauges.dcu in my Delphi library. You mentioned that the gauge control may not be registered. If that is the case how do I register it?

Thanks again.
 
The main form doesn't come up, but could this be because
some of the components referenced in the form are not registered?

That's possible.

If that is the case how do I register it?

It's under Install Packages in the Components menu. From there, it should give you an option to select a DPL file, and then hopefully it should go from there.
 
Hi,

I appreciate your trying to help, but I really have no clue what "go from there" means. I got to a menu with a huge list of dpl files, none of which were GAUGES, so I still really have no idea how to register the TGauge control.
 
I'm sorry, I really don't know Delphi 7 well enough. Like I said, TGauge shows up in the Samples menu of my controls. That equates to a Delphi package (DPL file) of some kind. For Delphi 3, the proper file to load is DCLSMP30.DPL, but I don't know the proper one for Delphi 7. You'll have to experiment some.
 
I don't have Delphi 7. I have Turbo Delphi 2006 and it doesn't allow packages to be added. There is some discussion in the reference manual of using the RegisterComponents procedure, but the instructions as to exactly what and where in Gauges.pas that code should appear are not at all clear. Moreover, I'm not even sure that the RegisterComponents function is supposed to be inserted somewhere else. I tried putting all that in Gauges.pas, and then I clicked on Add to Project, but that's probably wrong because I got an error message when I tried to build my program, [Pascal Error] gauges.pas(42)E2065 Unsatisfied forward or external declaration: TGauge.Register
 
I don't have Delphi 7. I have Turbo Delphi 2006 and it doesn't allow packages to be added.

I saw "Delphi 7" earlier...as far as Turbo Delphi 2006 goes, installing packages is a feature that was removed to make it Turbo Delphi, as opposed to Borland Developer Studio 2006. While the entry is there for the Samples package (TGauge is in that), it won't let you install it.

It seems like you won't have TGauge in Turbo Delphi.
 
I understand that packages can't be installed, but can the following be used in some way to add controls to the IDE visual editor:

unit Whatever;
interface
type

... { declare your component types here }procedure Register; { this must appear in the interface section }implementation
... { component implementation goes here }
procedure Register;

begin

RegisterComponents('Miscellaneous', [TGauge]);

end;
end.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top