Board index » delphi » Error: Method reference does not exist. Remove the reference?

Error: Method reference does not exist. Remove the reference?


2004-09-23 06:21:33 AM
delphi280
I have a TMyForm that inherits from TForm. TMyForm has a OnClose
event defined. My wizard creates an instance of TMyForm. Everything is created perfectly, however when I go to save the new form, I get the message "The FormClose method reference by TMyForm1.OnClose does not exist. Remove the reference?" The thing is, if I select the form, and "View as Text", and then switch back using "View as Form", I can not save without getting the message. Neither compile.
I didn't do anything to the DFM, I just view it and switch back. Is there something with Wizards and inheritance that I am missing?
I'm using Delphi 7 update pack 1 and the IOTAModuleCreator interface.
TIA
Marcio Duran
 
 

Re:Error: Method reference does not exist. Remove the reference?

I found the problem. It was my mistake.
I created a descendent form but didn't set the AncestorName: I declareded the new form as descendent directly in the code, like TMyForm = class(TAncestralForm).
To success, you have to do this and must set the AncestorName to the name of AncestralForm (without "T").
I hope this help someone.
"Marcio Duran" <XXXX@XXXXX.COM>writes:
Quote

I have a TMyForm that inherits from TForm. TMyForm has a OnClose
event defined. My wizard creates an instance of TMyForm. Everything is created perfectly, however when I go to save the new form, I get the message "The FormClose method reference by TMyForm1.OnClose does not exist. Remove the reference?" The thing is, if I select the form, and "View as Text", and then switch back using "View as Form", I can not save without getting the message. Neither compile.

I didn't do anything to the DFM, I just view it and switch back. Is there something with Wizards and inheritance that I am missing?

I'm using Delphi 7 update pack 1 and the IOTAModuleCreator interface.

TIA

Marcio Duran