views:

63

answers:

3

I have a Delphi project in 2007 that doesn't show the procedure names in the Object Inspector's Events such as Form OnClose, OnCreate or OnShow in the IDE. The code is there and if you click on OnCreate (for example) you are taken to the code and the IDE fills in the name of procedure. However on reload, the procedures are missing from the IDE again.

This same project causes various error messages when Delphi closes also, but I am not sure if this is related (no other project developed under this Delphi does but this one is the largest app and uses several 3rd party add-in libraries).

I have moved this app to various Delphi 2007 installations and it reacts the same, so it isn't a corrupt Delphi situation. Is there any way to rebuild or fix a corrupt project like this? Any help would be appreciated.

A: 

Try delete all the .DCU's, close Delphi, restart Delphi then rebuild your project.

Jeroen Pluimers
If this is happening across several different installations, that's not likely to be the problem.
Mason Wheeler
@Mason: I have seen similar things happen for a large project in multiple D2007 installations. My solution then worked, hence the answer I gave.
Jeroen Pluimers
+2  A: 

I would try to remove all the files and keep only the dpr and the pas/dfm files in case it's a corrupted project file.
I would also double check if there is any Form inheritance mess, as I have seen somewhat similar issues with the inherited event handlers. (look at the dfm files directly)

François
lgallion
A: 

Delphi's IDE takes several liberties with your code without warning you.

In particular : if you have a callback (eg: "TMyForm.FormCreate") linked in the dfm, and the IDE detects that the function's body is empty, when you save your unit, the ide removes the declaration and the implementation before saving your file.

Adding anything (even a simple "//") in the function's body prevents this : try typing some code or some comment in your function before closing your Delphi.

As for errors when Delphi closes, there can be so many reasons. Do you have any third-party components or experts installed ? Have you tried installing IDEFixpack for D2007 ?

LeGEC