Morning all,
I'm being plagued by a problem when I terminate a project I'm
working on. I mentioned this before, but perhaps if I provide more info
someone might be able to suggest where I can look for a solution.
First of all, the application's mainform is is not shown...ever!
It's a normal form but without borders, a caption, or icon. I'm using
'ShowMainForm := False' in the dpr right after the form is created, followed
by 'ShowMainFormOnTaskBar := False;'. Access to the application is provided
by a TrayIcon component and popupmenu on the mainform.
A number of things happen within the mainform, including the
creation and/or loading of an IniFile, the creation of a DataModule, and the
creation of the applications working form which provides a visual interface
for the user. The interface is created with Self as it's parameter, ( I've
also tried nil ), and all three of these objects are preset to nil in the
mainform's OnCreate, then tested to see if they are nil or not in the
mainform's OnClose event, and if they are not nil, their individual
FreeAndNil(IniFile), DataModule.Destroy, and InterfaceF.Close methods are
called.
The Interface Form is very complicated and makes use of many dynamic
TFrames, all of which are freed in it's own OnClose event, and I can close
down the Interface Form via it's System menu button with no errors or access
violations, so I know nothing I'm doing there could be causing the problem.
When I attempt to close the mainform down, even if everything else
has been free'd before hand except for the DataModule and IniFile, I get one
out of a variety of errors depending on the method I use to shut it down.
In it's ExitActionExecute, if I use MainF1.Close I get a series of
access violations I cannot find. If I use MainF1.Release I get a Pointer
error which leaves the application running, then if I try to exit a second
time I does exit correctly. If I use MainF1.Free, I get the same error as
with MainF1.Close, and if I use Application.Terminate, I get the Pointer
error again but no recovery.
All my Jcl debug info points to line 0 in the dpr, which is what it
always points to when it cannot resolve better information, and I've checked
and rechecked everything to see what might be causing the problem with no
luck. And it occurs whether I'm running from the IDE or alone.
As it seems the Pointer error is the one I need to figure out, can
anyone offer some examples of what might cause such an error? Any ideas
would be greatly appreciated. This kind of error I've never had before.
from Robert Meek dba "Tangentals Design"
e-mail: [EMAIL PROTECTED]
Freelance Windows Programming for XP and Vista
Also proud to be a Moderator of the "Delphi-List" at elists.org
"Reality cannot be explained...only enjoyed or endured as your current
perspective allows!"
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi