?
Solved

EAccessViolation

Posted on 2001-08-13
6
Medium Priority
?
589 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 200 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
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: 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

771 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