Click here to Skip to main content
14,767,119 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Declaring Variables Pin
Maximilien4-Feb-10 9:19
MemberMaximilien4-Feb-10 9:19 
GeneralRe: Declaring Variables Pin
gregarion4-Feb-10 9:34
Membergregarion4-Feb-10 9:34 
GeneralRe: Declaring Variables Pin
Richard MacCutchan4-Feb-10 9:47
mveRichard MacCutchan4-Feb-10 9:47 
GeneralRe: Declaring Variables Pin
gregarion4-Feb-10 9:53
Membergregarion4-Feb-10 9:53 
GeneralRe: Declaring Variables Pin
Richard MacCutchan4-Feb-10 12:38
mveRichard MacCutchan4-Feb-10 12:38 
GeneralRe: Declaring Variables Pin
Rozis4-Feb-10 13:42
MemberRozis4-Feb-10 13:42 
GeneralRe: Declaring Variables Pin
Richard MacCutchan4-Feb-10 23:04
mveRichard MacCutchan4-Feb-10 23:04 
GeneralRe: Declaring Variables Pin
Maximilien4-Feb-10 9:55
MemberMaximilien4-Feb-10 9:55 
Well, you need something to "hold" the data that class A will retrieve.

for example If class A is simply reading data from a file, then class B could hold the data for it.

For example in MFC, you have the class CStdioFile that only reads text from a file, but in a software that use that class, I will need something to hold the text (for example a vector of text lines that are read).

Another variation, sometimes if the class is more or less specialized it could be used to read and hold data at the same time.

for example I could have a class MyStdIoFile that is derived from CStdioFile that will not only read from the file, but store the data internally.

class MyStdIoFile : public CStdioFile 
{
  public:
   Read( CString path ){/* call code from CStdIoFile to read and put it in m_Data*/  };

  protected:
   vector<CString> m_Data;
}


again, there are tons of different ways of doing this, it's more a question of design than a question of code; who reads, who writes. who keep the data, who display the data, how is it read, how is it kept, how is it displayed.

Take a piece of paper and draw littles boxes representing your different objects and draw lines and arrows between them to show the relationships.

This signature was proudly tested on animals.

GeneralRe: Declaring Variables Pin
gregarion4-Feb-10 9:59
Membergregarion4-Feb-10 9:59 
AnswerRe: Code needed for Parsing PE for Exports Pin
Tim Craig4-Feb-10 9:32
MemberTim Craig4-Feb-10 9:32 
AnswerRe: Code needed for Parsing PE for Exports Pin
Richard MacCutchan4-Feb-10 9:45
mveRichard MacCutchan4-Feb-10 9:45 
QuestionC++ return value from function Pin
uusheikh4-Feb-10 8:11
Memberuusheikh4-Feb-10 8:11 
AnswerRe: C++ return value from function Pin
Nemanja Trifunovic4-Feb-10 8:27
MemberNemanja Trifunovic4-Feb-10 8:27 
GeneralRe: C++ return value from function Pin
uusheikh4-Feb-10 8:35
Memberuusheikh4-Feb-10 8:35 
GeneralRe: C++ return value from function Pin
Maximilien4-Feb-10 8:38
MemberMaximilien4-Feb-10 8:38 
GeneralRe: C++ return value from function Pin
Nemanja Trifunovic4-Feb-10 8:43
MemberNemanja Trifunovic4-Feb-10 8:43 
GeneralRe: C++ return value from function Pin
uusheikh4-Feb-10 9:18
Memberuusheikh4-Feb-10 9:18 
GeneralRe: C++ return value from function Pin
peterchen5-Feb-10 0:59
Memberpeterchen5-Feb-10 0:59 
AnswerRe: C++ return value from function Pin
David Crow4-Feb-10 9:33
MemberDavid Crow4-Feb-10 9:33 
AnswerRe: C++ return value from function Pin
fat_boy5-Feb-10 2:17
Memberfat_boy5-Feb-10 2:17 
QuestionCMiniFrameWnd Pin
Vaclav_4-Feb-10 5:25
MemberVaclav_4-Feb-10 5:25 
QuestionCppUnit testing Pin
gregarion4-Feb-10 3:40
Membergregarion4-Feb-10 3:40 
QuestionRe: CppUnit testing Pin
David Crow4-Feb-10 5:46
MemberDavid Crow4-Feb-10 5:46 
AnswerRe: CppUnit testing Pin
gregarion4-Feb-10 5:48
Membergregarion4-Feb-10 5:48 
QuestionHow to get the width and height of the Form Template Pin
Joschwenk6664-Feb-10 3:21
MemberJoschwenk6664-Feb-10 3:21 

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.