Solved

EAccessViolation

Posted on 2001-08-13
6
584 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
[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 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
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: 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

742 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