Re: Runtime Error 216?

From: Mathias Rauen (borland_at_nospam-madshi.net)
Date: 11/17/03


Date: Mon, 17 Nov 2003 11:48:15 +0100


> > Does the finalization exception occur when the database can't
> > be opened? Or does it occur, when everything seems to be in order?
> Only when the database can't be opened, I believe.

Would it make sense to replace the Application.Terminate statement
by an "ExitProcess(0)" call? This stops the application at once
without any further cleanup. Don't know whether that's good or bad
for you. It might be, that Application.Terminate makes problems the
way you call it.

> What happens is after tracing for quite a while I get to TControl.Destroy at
> the line
> inherited Destroy
> on line 3158 of Controls in the Delphi source, and it AVs there.
> Is there a way to work out what control it is unsuccessfully calling its
> inherited Destroy method of, or why there is a problem with this attempt to
> call the inherited destroy method?

You could count the number of controls where destroying works. Let's say
the program can destroy 10 controls successfully, then with the 11th
control the AV is fired. Okay, restart your program in the debugger. Let
the program destroy the 10 controls. Then before it can destroy the 11th
control (and raise that AV) ask "pointer(Self)" and "Self.ClassName" and
"Self.Name". This way you might be able to find out which control can't
be destroyed.

-- 
www.madshi.net
quality low level Delphi components
extended exception handling
API hooking, DLL injection
undocumented functionality


Relevant Pages

  • Re: Regarding DestroyWindow and CEdit dervied class
    ... I don't know what you mean by "a pointer containing" because a pointer can't point to more ... You can't call destroy and delete ... If you are creating edit controls and destroying them only to re-create new edit controls ... dead pointers from the array (typically, if you are destroying everything in the array, it ...
    (microsoft.public.vc.mfc)
  • Re: Access Subform Shows Deleted Form
    ... but showing something that has supposedly been ... The commands are there to make it possible to create or destroy forms ... controls is not an option; there are too many possible permutations. ... John Nurick ...
    (microsoft.public.access.forms)
  • Re: Fun with CStatic destructor
    ... I'm not doing anything special when I destroy the CStatics - I'm using ... The odd code in OnOKis because of the self-validating controls. ... Basically, if you pressed Return, they didn't validate until after the ... of windows that weren't there. ...
    (microsoft.public.vc.mfc)
  • Re: ActiveSheet.OLEObjects.Add resets globals to Nothing
    ... Adding worksheet controls appears to re-compile the project once the code ... Amongst other things global variables are destroyed but can get ... Even that could destroy globals in the other wb. ... Dim temp As Klass1 ...
    (microsoft.public.excel.programming)
  • Re: The Zen nature of a Delphi database application
    ... results directly to UI controls, then write data from the controls to ... then write data back from the modified objects to the DB for storage? ... I load the whole contents of the database into my business objects, ... I have dreamt of the perfect OO database application framework ...
    (comp.lang.pascal.delphi.misc)