Click here to Skip to main content
16,013,338 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pointer to an array... "char" Pin
SilverShalkin30-May-02 2:38
SilverShalkin30-May-02 2:38 
GeneralFlexGrid Sort Pin
29-May-02 13:31
suss29-May-02 13:31 
GeneralRe: FlexGrid Sort Pin
Christian Graus29-May-02 15:09
protectorChristian Graus29-May-02 15:09 
GeneralRe: FlexGrid Sort Pin
29-May-02 15:38
suss29-May-02 15:38 
GeneralCreate form controls at runtime Pin
Aaron Schaefer29-May-02 12:55
Aaron Schaefer29-May-02 12:55 
GeneralRe: Create form controls at runtime Pin
Matt Gullett29-May-02 12:52
Matt Gullett29-May-02 12:52 
GeneralRe: Create form controls at runtime Pin
Aaron Schaefer29-May-02 13:09
Aaron Schaefer29-May-02 13:09 
Generalfstream issues Pin
Alan Chambers29-May-02 10:45
Alan Chambers29-May-02 10:45 
Hi all, I just want wanted to know what the best way of loading a binary file was without using MFC (I can do it using CFile and CArchive). At the moment I want to load in a file format that composes of 7 integers into 7 different variables. I'm also a bit worried about the robustness of the procedure. At the moment I have:

#include fstream

ifstream fin(FilePath, ios::binary)
if (fin)
{
fin.read(var1, sizeof(int));
fin.read(var2, sizeof(int));
etc.
}
fin.close();

but this seems remarkably inefficient as opposed to using the (arrow, arrow)operator as with MFC. Is this the best way to do this kind of thing? I know there is a function fin.eof() which tests for the end of the file, but surely I can't add that before each variable extraction? Its more used for text files and character extraction isn't it? I just need the best way of going about loading the data in this format into the seven different variables WITHOUT MFC. Thanks to all who are thinking about a solution.

Alan.

"When I left you I was but the learner, now I am the master" - Darth Vader
GeneralRe: fstream issues Pin
Joaquín M López Muñoz29-May-02 11:12
Joaquín M López Muñoz29-May-02 11:12 
GeneralRe: fstream issues Pin
Alan Chambers29-May-02 11:21
Alan Chambers29-May-02 11:21 
GeneralProblem converting a CComBSTR to LPCTSTR with CW2CT Pin
JC Gauthier29-May-02 10:24
JC Gauthier29-May-02 10:24 
GeneralRe: Problem converting a CComBSTR to LPCTSTR with CW2CT Pin
soptest29-May-02 12:25
soptest29-May-02 12:25 
GeneralRe: Problem converting a CComBSTR to LPCTSTR with CW2CT Pin
JC Gauthier30-May-02 4:27
JC Gauthier30-May-02 4:27 
GeneralRe: Problem converting a CComBSTR to LPCTSTR with CW2CT Pin
soptest30-May-02 8:36
soptest30-May-02 8:36 
General_popen issue Pin
Stew29-May-02 9:41
Stew29-May-02 9:41 
GeneralRe: _popen issue Pin
Joaquín M López Muñoz29-May-02 9:46
Joaquín M López Muñoz29-May-02 9:46 
GeneralRe: _popen issue Pin
soptest29-May-02 9:56
soptest29-May-02 9:56 
GeneralWeird Keyboard Hooking Issue Pin
John Aldrich29-May-02 9:02
John Aldrich29-May-02 9:02 
GeneralRe: Weird Keyboard Hooking Issue Pin
Joaquín M López Muñoz29-May-02 9:34
Joaquín M López Muñoz29-May-02 9:34 
GeneralI think I got it now Pin
Joaquín M López Muñoz29-May-02 9:40
Joaquín M López Muñoz29-May-02 9:40 
GeneralMeasureItem doesn't get called. Pin
29-May-02 9:07
suss29-May-02 9:07 
GeneralRe: MeasureItem doesn't get called. Pin
Paul M Watt29-May-02 9:22
mentorPaul M Watt29-May-02 9:22 
GeneralRe: MeasureItem doesn't get called. Pin
29-May-02 9:46
suss29-May-02 9:46 
GeneralQuestion Pin
Steve L.29-May-02 9:04
Steve L.29-May-02 9:04 
GeneralRe: Question Pin
Mauricio Ritter29-May-02 9:20
Mauricio Ritter29-May-02 9:20 

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.