Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Access Violation

Posted on 1998-05-02
8
Medium Priority
?
2,435 Views
Last Modified: 2008-02-26
Acccess Violation:

I am aware of why it is happening, but how do find out where it is coming from?      

Acccess Violation at address 0049F42C
Read of address FFFFFFFF.

I am sure this question has been asked a thousand and one times.
0
Comment
Question by:engtech
[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
  • 4
  • 4
8 Comments
 
LVL 5

Expert Comment

by:inter
ID: 1340486
Hi,
This error happens when you try to read or write a memory location that is not accessable by your program. 0049f42c is the address of the code that codes this error. Read of address FFFFFFFF is the memory location you try to read. Consider the following:
1 - You have and integer variable which is -1, you try to typecast it to pointer and read it. Note that -1 = FFFFFFFF in longinteger(signed).
2 - You add -1 (or decrement) a pointer that is NIL and try to read it.
After this error occurs, From View->Find Error enter 49f42c and press enter. The Delphi mostly takes you yo the line of error. Send the lines that cause error here if you could not find the cause and we can work it out.
Regards,
Igor
0
 

Author Comment

by:engtech
ID: 1340487
Thankyou Igor.

I have also seen during my scrounge for new and interesting components an add-on to Delphi you may call it, that someone has written that does what you described but only better. Have you seen this as well?  
0
 
LVL 5

Expert Comment

by:inter
ID: 1340488
Did you solve the problem. The access violation is a common error as you aready not it. But think that, it is better to have access violation rather than a code piece changes the arbitrary locations in memory, so we are gratefull to protected memory kernel.(Any one I can just tell)
Regards, Igor
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:engtech
ID: 1340489
Adjusted points to 70
0
 

Author Comment

by:engtech
ID: 1340490
The problem was located, a few options needed to be turned on in Options before the debugging and Find Error would work.

The error located was a series of TComboBox(s).   It is in a procedure that is not called on startup but once the program is running by the user. The procedure reads:

procedure TToolsForm.ClearCoords(Sender: TObject);
var
  Match: integer;
begin
  FromStn.Items.Clear;
  ToStn.Items.Clear;
  BSStn.Items.Clear;
  FSStn.Items.Clear;
  SearchStn.Clear;
  for Match:= 1 to (TablesForm.CoordGrid.RowCount -1) do
    begin
      FromStn.Items[Match-1]:=(Trim(TablesForm.CoordGrid.Cells[1,Match]));
      ToStn.Items[Match-1]:=(Trim(TablesForm.CoordGrid.Cells[1,Match]));
      BSStn.Items[Match-1]:=(Trim(TablesForm.CoordGrid.Cells[1,Match]));
      FSStn.Items[Match-1]:=(Trim(TablesForm.CoordGrid.Cells[1,Match]));
      SearchStn.Items[Match-1]:=(Trim(TablesForm.CoordGrid.Cells[1,Match]));
    end;
end;


Why on earth FromStn.Items.Clear; and the other ComboBoxes are errors I dont know. The error is given at the start of the application. Can you assist?
0
 
LVL 5

Accepted Solution

by:
inter earned 400 total points
ID: 1340491
Hi,
My good friend, you can not assign a value to an empty location in any list type. I mean you first CLEAR all the lists and then assign to the locations. The correct way is as follows:

 for Match:= 1 to (TablesForm.CoordGrid.RowCount -1) do
          begin
            FromStn.Items.ADD(Trim(TablesForm.CoordGrid.Cells[1,Match]));
            ToStn.Items.ADD]:=(Trim(TablesForm.CoordGrid.Cells[1,Match]));
            BSStn.Items.ADD(Trim(TablesForm.CoordGrid.Cells[1,Match]));
            FSStn.Items.ADD(Trim(TablesForm.CoordGrid.Cells[1,Match]));
            SearchStn.ADD(Trim(TablesForm.CoordGrid.Cells[1,Match]));
          end;
May this solves the problem
Igor
0
 
LVL 5

Expert Comment

by:inter
ID: 1340492
Sorry, last line before the end of for loop be:
SearchStn.Lines.ADD(Trim(TablesForm.CoordGrid.Cells[1,Match]));
0
 

Author Comment

by:engtech
ID: 1340493
Adjusted points to 100
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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…
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…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

650 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