Solved

Access Violation when freeing a child form

Posted on 2002-07-29
15
333 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
Industry Leaders: 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

689 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