Testing Testing

This is the forum for miscellaneous technical/programming questions.

Moderator: 2ffat

Testing Testing

Postby AlBro » Wed Apr 29, 2015 6:59 am

Right here goes - currently have a project on c++ Builder6 - not xe6. Was contemplating migrating it to XE2 as a basis to be working on meantime - problem being that most of the older code re File I/O has changed - used to be able to use a string as the filename with fopen and all worked fine and well. To try and get used to the newer method of using handles I set up a small tester program with some data on screen - some in a listbox and just some other statictexts - to try and save it to file and then reload it and place it back on screen just to get the hang of using as I say handles - the data is not important with this - the problem Im finding is that when compiling it goes fine and successfully compiles - but when run I keep getting an access violation at 3265a9c6 read of address 0x00000004. No matter what Ive tried - probably something simple it just will not run - any ideas on what Im missing...
AlBro
 
Posts: 4
Joined: Mon Apr 13, 2015 9:00 am

Re: Testing Testing

Postby rlebeau » Wed Apr 29, 2015 8:29 pm

AlBro wrote:problem being that most of the older code re File I/O has changed


No, it hasn't.

AlBro wrote:used to be able to use a string as the filename with fopen and all worked fine and well.


You still can. Just be sure you are using an AnsiString or std::string instead of a UnicodeString. Otherwise, use _wfopen() instead.

AlBro wrote:when run I keep getting an access violation at 3265a9c6 read of address 0x00000004.


A failure at a memory address near zero means you accessing something through a NULL pointer.
Remy Lebeau (TeamB)
Lebeau Software
User avatar
rlebeau
BCBJ Author
BCBJ Author
 
Posts: 1532
Joined: Wed Jun 01, 2005 3:21 am
Location: California, USA


Return to Technical

Who is online

Users browsing this forum: Google [Bot] and 19 guests

cron