Solved

Access Violation when freeing a child form

Posted on 2002-07-29
15
332 Views
Last Modified: 2010-04-04
I'm writing an MDI app. When the child forms are closed I want them to close rather than be minimised, so I've added

Action := caFree;

to the form's OnClose event. Now whenever the child form is closed I get

Project Calls.exe raised exception class EAccessViolation with message 'Access violation at address 00000000. Read of address 00000000'. Process stopped etc

If I don't add the action := cafree line the form minimises and I don't get an error.

Thanks for your help.
0
Comment
Question by:riccohb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
  • +2
15 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7186042
too rare information,

caFree work normally properly,
there must be some other

maybe a object-reference on the form,
which is lost if you free the form

meikl ;-)
0
 
LVL 12

Expert Comment

by:Lee_Nover
ID: 7186509
yep, most probably reference to some freed pointer (object)
0
 
LVL 4

Expert Comment

by:jsweby
ID: 7186523
Is "Action := caFree" the last line in your FormClose event?

J.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:riccohb
ID: 7187384
I've just added a blank form to the project with just Action := caFree in the form's OnClose event and the problem still happened.

jsweby - yes, it is the last line. Usually it's the only line in that procedure.
0
 
LVL 4

Expert Comment

by:jsweby
ID: 7187389
Can you show us how you are creating the form - the whole procedure where you decide you want to show the form.

J.
0
 
LVL 6

Accepted Solution

by:
swift99 earned 100 total points
ID: 7189063
It sounds like your master form is looking at an object on the form you're freeing.  Or you may have a recursive reference.
0
 

Author Comment

by:riccohb
ID: 7190145
The master form was, as you say, referencing the form immediately after it closed.

I'll also give points to jsweby in a 'points for jsweby' question.

Thanks folks.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7190153
and me?

at least i suggested
>maybe a object-reference on the form,
>which is lost if you free the form
first

meikl ;-)

0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7190154
maybe i was ignored :-(
0
 

Author Comment

by:riccohb
ID: 7190185
Sorry Kretzschmar. I inadvertently overlooked you. An honest mistake! I've just awarded my last 40 points to jsweby but I'm about to go on an answering spree to earn more points, and when I do I'll ask a 'points for kretzschmar' question.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7193144
well, ok ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7202799
some days ago . . .
0
 

Author Comment

by:riccohb
ID: 7202818
Patience...
0
 

Author Comment

by:riccohb
ID: 7216422
Kretzchmar - I've now posted your 'points for Kretzschmar' question.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7216430
thanks
yippi :-))
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question