|Subject:||How can this happen ?|
|Posted by:||Mike M (mi…@nowhere.com)|
|Date:||Wed, 28 Mar 2007|
I have been dabbling with delphi for about 10 years, but this is the first
time I have seen this...
When the user clicks a button, the code should create a form and show it
(I put in the showmessage line below because I was getting a memory related
exception on the ".create" line).
frmAccountEdit : tfrmAccountEdit;
if frmAccountEdit <> nil then
showmessage('What is going on here');
frmAccountEdit := tfrmaccountedit.Create(application);
I am not getting past the "showmessage" line - ie even though
"frmAccountEdit" is a local variable, it is not nil at the start of the
procedure ! Most of the forms in the project are shown modally, and this
is the only one where the problem arises. I have tried creating / showing
the form from a different part of the project, and the same thing happens.
I have done a full search of the code in the project, and the variable
"frmAccountEdit" does not appear anywhere else apart from this procedure.
I have added code to check first if any of the screen object's forms are of
type TfrmAccountEdit - and there are none.
I reboot my machine and start again, and the exception happens again.
There is no variable for the "frmAccountEdit" form name in the form module
itself, and no "TfrmAccountEdit" form is created in the project code.
I tried removing the form variable - eg
with tfrmaccountedit.Create(nil) do
AND I still get the memory exception when it tries to create the form.
I am at a loss ! Anyone have any ideas ?