Solved

Access Violation when freeing a child form

Posted on 2002-07-29
15
328 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
  • 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now