Click here to Skip to main content
15,913,361 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Does Worker Thread Have a Message Queue Pin
ForNow3-Jun-12 10:01
ForNow3-Jun-12 10:01 
GeneralRe: Does Worker Thread Have a Message Queue Pin
Aescleal4-Jun-12 0:08
Aescleal4-Jun-12 0:08 
GeneralRe: Does Worker Thread Have a Message Queue Pin
Albert Holguin4-Jun-12 8:07
professionalAlbert Holguin4-Jun-12 8:07 
AnswerRe: Does Worker Thread Have a Message Queue Pin
Erudite_Eric2-Jun-12 21:13
Erudite_Eric2-Jun-12 21:13 
GeneralRe: Does Worker Thread Have a Message Queue Pin
Albert Holguin4-Jun-12 8:09
professionalAlbert Holguin4-Jun-12 8:09 
Questionhow to right vector of pointers to binary file ? Pin
Asaf Shay2-Jun-12 10:02
Asaf Shay2-Jun-12 10:02 
AnswerRe: how to right vector of pointers to binary file ? Pin
Chris Losinger2-Jun-12 17:22
professionalChris Losinger2-Jun-12 17:22 
AnswerRe: how to right vector of pointers to binary file ? Pin
«_Superman_»2-Jun-12 17:29
professional«_Superman_»2-Jun-12 17:29 
There are several things wrong here.
First of, all pointers will be of the same size.
On a 32-bit OS, all pointers are 4 bytes or 32-bits and on a 64-bit OS, all pointers are 8 bytes or 64-bits.
Secondly, you do not want to persist pointers to a file, because they will not be valid when you read it back into the program as the address is not guaranteed to be the same every time the program is run.

So what you need is to have a vector of objects/data type instead of a vector of pointers. This is the recommended method.
Have a method of the object to return the data to be persisted.
Typically this must be a structure.
In the main program iterate through the elements of the vector, call the method that returns the data to be persisted and write it to a file.
You can use any of the file operation routines like CreateFile/WriteFile or fopen/fwrite to do this.

You would also need a method of the object to put back the data when you read it from the file.
«_Superman 
I love work. It gives me something to do between weekends.


Microsoft MVP (Visual C++)

Polymorphism in C

GeneralRe: how to right vector of pointers to binary file ? Pin
Asaf Shay3-Jun-12 6:39
Asaf Shay3-Jun-12 6:39 
GeneralRe: how to right vector of pointers to binary file ? Pin
«_Superman_»3-Jun-12 15:19
professional«_Superman_»3-Jun-12 15:19 
QuestionHow to get static splitter right pane dimensions - size? Pin
Vaclav_1-Jun-12 9:56
Vaclav_1-Jun-12 9:56 
AnswerRe: How to get static splitter right pane dimensions - size? Pin
«_Superman_»1-Jun-12 17:59
professional«_Superman_»1-Jun-12 17:59 
QuestionCopying vector of pointers to another vector Pin
a1_shay1-Jun-12 6:58
a1_shay1-Jun-12 6:58 
QuestionRe: Copying vector of pointers to another vector Pin
Code-o-mat1-Jun-12 10:58
Code-o-mat1-Jun-12 10:58 
AnswerRe: Copying vector of pointers to another vector Pin
a1_shay1-Jun-12 11:29
a1_shay1-Jun-12 11:29 
GeneralRe: Copying vector of pointers to another vector Pin
lewax001-Jun-12 11:56
lewax001-Jun-12 11:56 
GeneralRe: Copying vector of pointers to another vector Pin
a1_shay1-Jun-12 12:06
a1_shay1-Jun-12 12:06 
GeneralRe: Copying vector of pointers to another vector Pin
lewax001-Jun-12 12:14
lewax001-Jun-12 12:14 
GeneralRe: Copying vector of pointers to another vector Pin
a1_shay1-Jun-12 12:30
a1_shay1-Jun-12 12:30 
QuestionUse OLE Pin
MKC0021-Jun-12 5:42
MKC0021-Jun-12 5:42 
SuggestionRe: Use OLE Pin
David Crow1-Jun-12 6:49
David Crow1-Jun-12 6:49 
GeneralRe: Use OLE Pin
MKC0021-Jun-12 23:15
MKC0021-Jun-12 23:15 
QuestionRe: Use OLE Pin
David Crow4-Jun-12 2:40
David Crow4-Jun-12 2:40 
AnswerRe: Use OLE Pin
MKC0024-Jun-12 4:33
MKC0024-Jun-12 4:33 
AnswerRe: Use OLE Pin
David Crow4-Jun-12 5:07
David Crow4-Jun-12 5:07 

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.