Solved

EAccessViolation

Posted on 2001-08-13
6
579 Views
Last Modified: 2010-04-06
When referring to another unit in a Delphi 4 app I get the following error...

Project SysAdmin.exe raised exception class EAccessViolation with message 'Access violation at address 0046C332 in module 'SysAdmin.exe'. Read of address 000002F0...'

This happens when a unit called 'frmBoxName' refers to a unit called 'frmDeleter' like this...

with frmDeleter do
     if gridDeleter.RowCount > 0 then
        btnOK.Enabled := True
     else
        btnOK.Enabled := False;
Release;

The error occurs on the first 'if' statement. If I comment out this entire procedure the same error occurs next time I refer to frmDeleter.

In fact, I get the error whenever any of my forms refer to any of the others...

Both frmDeleter and frmBoxName are included in each other's relevant uses clause.

I'm sure this is really easy, because I'm sure I've done it before successfully and I've done something really daft this time...
0
Comment
Question by:riccohb
6 Comments
 
LVL 4

Accepted Solution

by:
fva earned 50 total points
ID: 6380100
Any chance you forgot to create the actual instance of TfrmDeleter into frmDeleter variable? Or that by the time you use frmDeleter the creation is not done yet?

Other idea: Any DLL involved in this?

F.
0
 
LVL 20

Expert Comment

by:Madshi
ID: 6380139
Yes, fva is right, I guess your frmDeleter variable is "nil".

Regards, Madshi.
0
 
LVL 2

Expert Comment

by:FrodoBeggins
ID: 6380146
Or maybe the form is freed ...

Rgds,
Frodo

0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

Author Comment

by:riccohb
ID: 6380153
There you go - I told you it was a stupid mistake. I've just added

var frmDeleter: Tfrmdeleter;

to that procedure and it worked perfectly. Thanks.
0
 
LVL 4

Expert Comment

by:YodaMage
ID: 6380154
I think fva is right on. Either you are trying to work with forms that have not been created, or with forms that haved already been freed/destroyed.
0
 
LVL 4

Expert Comment

by:YodaMage
ID: 6380159
DOH!
0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

803 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