Solved

EAccessViolation

Posted on 2001-08-13
6
574 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

9 Experts available now in Live!

Get 1:1 Help Now