engtech
asked on
Access Violation
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.
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.
ASKER
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?
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?
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
Regards, Igor
ASKER
Adjusted points to 70
ASKER
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(Sen der: 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.RowC ount -1) do
begin
FromStn.Items[Match-1]:=(T rim(Tables Form.Coord Grid.Cells [1,Match]) );
ToStn.Items[Match-1]:=(Tri m(TablesFo rm.CoordGr id.Cells[1 ,Match]));
BSStn.Items[Match-1]:=(Tri m(TablesFo rm.CoordGr id.Cells[1 ,Match]));
FSStn.Items[Match-1]:=(Tri m(TablesFo rm.CoordGr id.Cells[1 ,Match]));
SearchStn.Items[Match-1]:= (Trim(Tabl esForm.Coo rdGrid.Cel ls[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?
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(Sen
var
Match: integer;
begin
FromStn.Items.Clear;
ToStn.Items.Clear;
BSStn.Items.Clear;
FSStn.Items.Clear;
SearchStn.Clear;
for Match:= 1 to (TablesForm.CoordGrid.RowC
begin
FromStn.Items[Match-1]:=(T
ToStn.Items[Match-1]:=(Tri
BSStn.Items[Match-1]:=(Tri
FSStn.Items[Match-1]:=(Tri
SearchStn.Items[Match-1]:=
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry, last line before the end of for loop be:
SearchStn.Lines.ADD(Trim(T ablesForm. CoordGrid. Cells[1,Ma tch]));
SearchStn.Lines.ADD(Trim(T
ASKER
Adjusted points to 100
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