Click here to Skip to main content
15,886,199 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C program to start before windows boot Pin
ayandelhi26-Jul-11 3:24
ayandelhi26-Jul-11 3:24 
QuestionProblems with structures Pin
rahul.kulshreshtha22-Jul-11 20:45
rahul.kulshreshtha22-Jul-11 20:45 
QuestionRe: Problems with structures Pin
Rajesh R Subramanian22-Jul-11 21:04
professionalRajesh R Subramanian22-Jul-11 21:04 
AnswerRe: Problems with structures Pin
rahul.kulshreshtha22-Jul-11 21:31
rahul.kulshreshtha22-Jul-11 21:31 
AnswerRe: Problems with structures Pin
Rajesh R Subramanian22-Jul-11 21:37
professionalRajesh R Subramanian22-Jul-11 21:37 
GeneralRe: Problems with structures Pin
rahul.kulshreshtha22-Jul-11 22:05
rahul.kulshreshtha22-Jul-11 22:05 
GeneralRe: Problems with structures Pin
rahul.kulshreshtha22-Jul-11 22:13
rahul.kulshreshtha22-Jul-11 22:13 
AnswerRe: Problems with structures Pin
John R. Shaw23-Jul-11 7:47
John R. Shaw23-Jul-11 7:47 
The only problem I see is the non-portability of writing the structure to the file instead of individual items. That is compiler structure [type] alignment dependent and may change from one compiler to the next or one version of the compiler to the next.

Your solution sounds like a simple application of the KISS principle and avoids the problems of more complex solutions. Just add a header of some kind to the file. The header should contain an identifier, marking the file as the correct type, and a version number indicating the format type (a.k.a. data type [structure type]). This also has the advantage of being cross-language and cross-platform supportable.

It sounds like all the data is read into memory at start up. In that case you only need one method (function) to read the file and convert it to the internal data structure at start up and one for writing it (if it has changed) out when shutting down.

I used the above method in a commercial application (originally written in C) that supports file formats going back over 20 years. This is comparable to reading and writing Word or other document types that contain version specific format support.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence." - Edsger Dijkstra
"I have never been lost, but I will admit to being confused for several weeks. " - Daniel Boone

QuestionHow can CString be converted to LPCTSTR without any operator()? Pin
Dean Seo22-Jul-11 17:09
Dean Seo22-Jul-11 17:09 
AnswerRe: How can CString be converted to LPCTSTR without any operator()? Pin
Rajesh R Subramanian22-Jul-11 21:06
professionalRajesh R Subramanian22-Jul-11 21:06 
GeneralRe: How can CString be converted to LPCTSTR without any operator()? Pin
Mark Salsbery23-Jul-11 6:20
Mark Salsbery23-Jul-11 6:20 
GeneralRe: How can CString be converted to LPCTSTR without any operator()? Pin
Rajesh R Subramanian23-Jul-11 7:05
professionalRajesh R Subramanian23-Jul-11 7:05 
QuestionRe: How can CString be converted to LPCTSTR without any operator()? Pin
Dean Seo24-Jul-11 2:10
Dean Seo24-Jul-11 2:10 
AnswerRe: How can CString be converted to LPCTSTR without any operator()? Pin
Rajesh R Subramanian24-Jul-11 3:20
professionalRajesh R Subramanian24-Jul-11 3:20 
GeneralRe: How can CString be converted to LPCTSTR without any operator()? Pin
Dean Seo25-Jul-11 16:44
Dean Seo25-Jul-11 16:44 
QuestionAfxGetMainWnd() equals to AfxGetMainWnd ? Pin
yu-jian21-Jul-11 16:24
yu-jian21-Jul-11 16:24 
AnswerRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
Mark Salsbery21-Jul-11 17:06
Mark Salsbery21-Jul-11 17:06 
GeneralRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
yu-jian25-Jul-11 4:16
yu-jian25-Jul-11 4:16 
AnswerRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
Richard MacCutchan21-Jul-11 22:05
mveRichard MacCutchan21-Jul-11 22:05 
AnswerRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
Stefan_Lang22-Jul-11 0:20
Stefan_Lang22-Jul-11 0:20 
JokeRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
«_Superman_»22-Jul-11 2:30
professional«_Superman_»22-Jul-11 2:30 
GeneralRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
Richard MacCutchan22-Jul-11 4:18
mveRichard MacCutchan22-Jul-11 4:18 
GeneralRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
«_Superman_»22-Jul-11 6:03
professional«_Superman_»22-Jul-11 6:03 
GeneralRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
Richard MacCutchan22-Jul-11 22:58
mveRichard MacCutchan22-Jul-11 22:58 
GeneralRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
«_Superman_»23-Jul-11 4:01
professional«_Superman_»23-Jul-11 4: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.