Click here to Skip to main content
15,909,939 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionENTER on Button Pin
RadioOpa8-Feb-06 2:31
RadioOpa8-Feb-06 2:31 
AnswerRe: ENTER on Button Pin
Roger Stoltz8-Feb-06 3:03
Roger Stoltz8-Feb-06 3:03 
GeneralRe: ENTER on Button Pin
RadioOpa8-Feb-06 3:33
RadioOpa8-Feb-06 3:33 
QuestionBinary File Question Pin
mcb368-Feb-06 2:13
mcb368-Feb-06 2:13 
AnswerRe: Binary File Question Pin
Cedric Moonen8-Feb-06 2:23
Cedric Moonen8-Feb-06 2:23 
GeneralRe: Binary File Question Pin
mcb368-Feb-06 2:34
mcb368-Feb-06 2:34 
GeneralRe: Binary File Question Pin
Cedric Moonen8-Feb-06 2:43
Cedric Moonen8-Feb-06 2:43 
AnswerRe: Binary File Question Pin
kakan8-Feb-06 2:52
professionalkakan8-Feb-06 2:52 
You can do it by using a chunk file. (An old Mac-invention if my mind serves me right).

It works like this:
Every item in a chunk file consists of a header and a (binary) data block.

The header has a fixed length (a struct), containing a label and the length of the following data block.

So when you write it, fill in the fields in the header and write it to the chunk file. Then write the data block to the chunk file.

When you read the chunk file, first read the header. Then you will know:
1.
The identification of the data block. (I.e. the class name)
2.
The data length (of the following data block).
Now you can choose either to read the data block, or discard it and continue reading the next header.

I have been using chunk files a lot in my work because:
1.
Every item is marked so I know in advance what data I can expect.
2.
I can easily skip the kind of data I don't want to read back.

Maybe you can try one?

Kakan


-- modified at 8:53 Wednesday 8th February, 2006
I agree with Cedric Moonen, you should have a look at serialisation. But if you find it less usable for you, the have a look at chunk files.
GeneralRe: Binary File Question Pin
mcb368-Feb-06 3:30
mcb368-Feb-06 3:30 
AnswerRe: Binary File Question Pin
Ravi Bhavnani8-Feb-06 11:32
professionalRavi Bhavnani8-Feb-06 11:32 
QuestionDeployment of VC++ Applicaations Pin
Jeeva Mary Varghese8-Feb-06 2:09
Jeeva Mary Varghese8-Feb-06 2:09 
AnswerRe: Deployment of VC++ Applicaations Pin
toxcct8-Feb-06 2:13
toxcct8-Feb-06 2:13 
AnswerRe: Deployment of VC++ Applicaations Pin
Ravi Bhavnani8-Feb-06 11:34
professionalRavi Bhavnani8-Feb-06 11:34 
AnswerRe: Deployment of VC++ Applicaations Pin
ThatsAlok8-Feb-06 18:53
ThatsAlok8-Feb-06 18:53 
QuestionHow to get the letter to a drivename? Pin
ahmet07038-Feb-06 2:02
ahmet07038-Feb-06 2:02 
AnswerRe: How to get the letter to a drivename? Pin
David Crow8-Feb-06 3:49
David Crow8-Feb-06 3:49 
GeneralRe: How to get the letter to a drivename? Pin
Rage8-Feb-06 6:26
professionalRage8-Feb-06 6:26 
GeneralRe: How to get the letter to a drivename? Pin
David Crow8-Feb-06 6:43
David Crow8-Feb-06 6:43 
GeneralRe: How to get the letter to a drivename? Pin
Rage8-Feb-06 6:27
professionalRage8-Feb-06 6:27 
GeneralRe: How to get the letter to a drivename? Pin
ahmet07038-Feb-06 20:33
ahmet07038-Feb-06 20:33 
QuestionScrollView doesn't paint correctly Pin
#realJSOP8-Feb-06 1:57
professional#realJSOP8-Feb-06 1:57 
QuestionAssertion error in OnDraw Pin
Anu_Bala8-Feb-06 0:55
Anu_Bala8-Feb-06 0:55 
AnswerRe: Assertion error in OnDraw Pin
Abebe8-Feb-06 1:20
Abebe8-Feb-06 1:20 
GeneralRe: Assertion error in OnDraw Pin
Anu_Bala8-Feb-06 16:44
Anu_Bala8-Feb-06 16:44 
GeneralRe: Assertion error in OnDraw Pin
_anil_8-Feb-06 19:03
_anil_8-Feb-06 19:03 

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.