Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 3212

"Access violation at address 00404986 in module 'Project7.exe'. Read of address 9000092E."

$
0
0

I'm hearing different things from different people about whether it's better (and faster) to post a question here or in the developpers' forum. As an experiment, I'm posting the following question (which I hope is short) in both places. I hope that's not inappropriate. River_Forest

---------------------------------

The error I'm getting when I run my project is:
Access violation at address 00404986 in module 'Project7.exe'. Read of address 9000092E.

Below is the code that causes the problem (stripped down from a larger project).

void TForm9::initialize() {
FILE *in;
String recordfilename = "c:/c++builder/chmode_1_record.txt";
TStringList *Record;

bool recordfileexists = false;
if ( (in = fopen(AnsiString(recordfilename).c_str(), "r")) != NULL) {
recordfileexists = true;
Record->LoadFromFile(recordfilename);
fclose(in);
}
}

When I walk through with the debugger, the program recognizes that the file exists and enters the code governed by the 'if'. It sets 'recordfileexists' to 'true', but then when it tries to execute the 'LoadFromFile()', that's when I get the error.

This is particularly frustrating, becaue I swear I have used this identical code in a number of other projects and not had a problem.

All help with be appreciated.

River_Forest


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>