Click here to Skip to main content
16,003,454 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCListCtrl Scrolling Question Pin
14-Jun-01 10:30
suss14-Jun-01 10:30 
GeneralAgain...Win9X and NT compatibility problem Pin
14-Jun-01 10:27
suss14-Jun-01 10:27 
GeneralRe: Again...Win9X and NT compatibility problem Pin
Tomasz Sowinski15-Jun-01 0:21
Tomasz Sowinski15-Jun-01 0:21 
GeneralUsing STL map<...> Pin
Rostrox14-Jun-01 10:11
Rostrox14-Jun-01 10:11 
GeneralRe: Using STL map<...> Pin
Ben Burnett14-Jun-01 15:15
Ben Burnett14-Jun-01 15:15 
GeneralRe: Using STL map<...> Pin
14-Jun-01 17:02
suss14-Jun-01 17:02 
GeneralRe: Using STL map<...> Pin
markkuk14-Jun-01 20:35
markkuk14-Jun-01 20:35 
GeneralReading and Writing files in Win32 Pin
14-Jun-01 9:11
suss14-Jun-01 9:11 
I have a custom database file (a simple character-delimited text file, if you would like to know) I need to read/write to in a Wizard-made Database program in MSVC++. The project was specified as a single-document database program. I'm having trouble figuring out how to read and write to the file. I assigned a CArchive Serialization function to a button, and when I hit it, I get an Invalid Page Fault. If you feel like laughing, here's the function:

void CDCDBIIView::OnButtonReadFile(CArchive &ar)
{
ar.ReadString(m_FILE); //CArchive object ar created in CDCDBIIDoc::Serialize(CArchive &ar)
UpdateData (FALSE);
}

Something's wrong with my logic in the ar.ReadString line, because that's the only line in the function doing any serious work. (UpdateData just...well, updates the data with the new info.) Right now, I'm not worried about parsing the input I'm getting in the archive, I just have m_FILE assigned to a read-only edit box so I can see if the program is reading from the file at all.

What I need to know is do I need to add a custom function to load/read/write to the open file, or do I add it to one of the many classes the MSVC++ Wizard built? I've read as many tuts as possible on CFile and CArchive, and MSDN isn't helping much. Any help would be greatly appreciated.

-Trying to be as informative as possible while knowing almost nothing at all
GeneralRe: Reading and Writing files in Win32 Pin
14-Jun-01 9:54
suss14-Jun-01 9:54 
GeneralGetting data from MSCOMM !!! Pin
Hadi Rezaee14-Jun-01 8:59
Hadi Rezaee14-Jun-01 8:59 
GeneralLoading small, built-in icons Pin
14-Jun-01 7:17
suss14-Jun-01 7:17 
GeneralRe: Loading small, built-in icons Pin
Ben Burnett14-Jun-01 7:41
Ben Burnett14-Jun-01 7:41 
GeneralRe: Loading small, built-in icons Pin
14-Jun-01 7:57
suss14-Jun-01 7:57 
GeneralRe: Loading small, built-in icons Pin
14-Jun-01 8:03
suss14-Jun-01 8:03 
GeneralRe: Loading small, built-in icons Pin
Ben Burnett14-Jun-01 9:19
Ben Burnett14-Jun-01 9:19 
Generalprint preview and multi frame app Pin
SAWilde14-Jun-01 6:35
SAWilde14-Jun-01 6:35 
GeneralSplitter window using C and NOT C++ Pin
14-Jun-01 6:33
suss14-Jun-01 6:33 
GeneralRe: Splitter window using C and NOT C++ Pin
Tomasz Sowinski15-Jun-01 0:01
Tomasz Sowinski15-Jun-01 0:01 
Generalarray of checkboxes Pin
14-Jun-01 6:18
suss14-Jun-01 6:18 
GeneralRe: array of checkboxes Pin
Carlos Antollini14-Jun-01 6:27
Carlos Antollini14-Jun-01 6:27 
Generalfine, don't answer my question, see if i care Pin
Amit Jain14-Jun-01 5:29
Amit Jain14-Jun-01 5:29 
GeneralRe: fine, don't answer my question, see if i care Pin
Tim Deveaux14-Jun-01 14:59
Tim Deveaux14-Jun-01 14:59 
GeneralRe: fine, don't answer my question, see if i care Pin
Amit Jain15-Jun-01 4:13
Amit Jain15-Jun-01 4:13 
GeneralSerialization question Pin
mr200314-Jun-01 4:15
mr200314-Jun-01 4:15 
GeneralRe: Serialization question Pin
Ben Burnett14-Jun-01 8:01
Ben Burnett14-Jun-01 8:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.