Click here to Skip to main content
15,919,028 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: LoadImage returns handle instead of NULL Pin
David Crow10-Dec-03 8:06
David Crow10-Dec-03 8:06 
GeneralRe: LoadImage returns handle instead of NULL Pin
Tim Smith10-Dec-03 16:08
Tim Smith10-Dec-03 16:08 
GeneralRe: LoadImage returns handle instead of NULL Pin
mexicanchili11-Dec-03 3:24
mexicanchili11-Dec-03 3:24 
QuestionShould I be using struct instead? Pin
b_girl10-Dec-03 3:23
b_girl10-Dec-03 3:23 
AnswerRe: Should I be using struct instead? Pin
Antti Keskinen10-Dec-03 3:39
Antti Keskinen10-Dec-03 3:39 
GeneralRe: Should I be using struct instead? Pin
b_girl10-Dec-03 4:25
b_girl10-Dec-03 4:25 
GeneralRe: Should I be using struct instead? Pin
Antti Keskinen10-Dec-03 7:43
Antti Keskinen10-Dec-03 7:43 
AnswerRe: Should I be using struct instead? Pin
Navin10-Dec-03 4:49
Navin10-Dec-03 4:49 
I am going to have to disagree with the other poster and say do NOT use serialization!

What I would do (and have done) in your position is to make some general purpose classes. How specific is your data? You could make a class that knows how to read/write itself, and has members for all the data. Or you could write a more generic class, that can take name=value pairs (such as an INI file.)

An example of a simple interface for a class that might look like something you'd use:
class MyData
{
public:
  bool ReadDataFromFile(CString filePath);
  bool WriteDataToFile(CString filePath);

  void SetSomePieceOfData(CString data); 
...
private:
  // Store data as private members, then the ReadDataFromFile and
  // WriteDataToFile will use them when accessing the text file.
  CString somePieceOfData;
};


The reasons I would avoid serialization:
1. It is a nightmare if you ever want to change your file format, or, heaven forbid, you need to access these files from some other non-MFC program.
2. It is difficult to debug. A text file, you can just open it in Notepad and figure out what is going on. Not as easy with serialized data. It is not impossible, there are tools to do it, but it is a pain.



No single raindrop believes that it is responsible for the flood.
GeneralRe: Should I be using struct instead? Pin
b_girl10-Dec-03 5:04
b_girl10-Dec-03 5:04 
GeneralRe: Should I be using struct instead? Pin
Big Art10-Dec-03 6:02
Big Art10-Dec-03 6:02 
GeneralRe: Should I be using struct instead? Pin
b_girl10-Dec-03 6:10
b_girl10-Dec-03 6:10 
QuestionHow to interpret Call stack window message ? Pin
Deepak Samuel10-Dec-03 2:35
Deepak Samuel10-Dec-03 2:35 
AnswerRe: How to interpret Call stack window message ? Pin
Mike Dimmick10-Dec-03 2:41
Mike Dimmick10-Dec-03 2:41 
GeneralDLL Dialog Pin
macmac3810-Dec-03 2:18
macmac3810-Dec-03 2:18 
GeneralRe: DLL Dialog Pin
Antti Keskinen10-Dec-03 3:04
Antti Keskinen10-Dec-03 3:04 
GeneralRe: DLL Dialog Pin
macmac3810-Dec-03 4:46
macmac3810-Dec-03 4:46 
GeneralSearching in a DC Pin
Tommy2k10-Dec-03 2:05
Tommy2k10-Dec-03 2:05 
GeneralRe: Searching in a DC Pin
Antti Keskinen10-Dec-03 3:09
Antti Keskinen10-Dec-03 3:09 
QuestionHow to transparentize a window under Win9x? Pin
dot9910-Dec-03 1:31
dot9910-Dec-03 1:31 
AnswerRe: How to transparentize a window under Win9x? Pin
Antti Keskinen10-Dec-03 3:23
Antti Keskinen10-Dec-03 3:23 
GeneralRe: How to transparentize a window under Win9x? Pin
dot9910-Dec-03 3:53
dot9910-Dec-03 3:53 
GeneralRe: How to transparentize a window under Win9x? Pin
Antti Keskinen10-Dec-03 8:02
Antti Keskinen10-Dec-03 8:02 
GeneralRe: How to transparentize a window under Win9x? Pin
dot9910-Dec-03 12:09
dot9910-Dec-03 12:09 
AnswerRe: How to transparentize a window under Win9x? Pin
Member 36996310-Dec-03 12:17
Member 36996310-Dec-03 12:17 
AnswerRe: How to transparentize a window under Win9x? Pin
Anonymous10-Dec-03 18:35
Anonymous10-Dec-03 18:35 

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.