Click here to Skip to main content
15,904,416 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C help Pin
Gary R. Wheeler21-Sep-03 2:30
Gary R. Wheeler21-Sep-03 2:30 
GeneralC++ Question. Pin
WREY20-Sep-03 11:57
WREY20-Sep-03 11:57 
GeneralRe: C++ Question. Pin
Neville Franks20-Sep-03 12:23
Neville Franks20-Sep-03 12:23 
GeneralRe: C++ Question. Pin
Mike Dimmick20-Sep-03 12:45
Mike Dimmick20-Sep-03 12:45 
GeneralRe: C++ Question. Pin
WREY20-Sep-03 17:51
WREY20-Sep-03 17:51 
GeneralRe: C++ Question. Pin
Neville Franks21-Sep-03 0:02
Neville Franks21-Sep-03 0:02 
GeneralRe: C++ Question. Pin
Rickard Andersson2021-Sep-03 0:49
Rickard Andersson2021-Sep-03 0:49 
GeneralRe: C++ Question. Pin
Mike Dimmick21-Sep-03 1:13
Mike Dimmick21-Sep-03 1:13 
Usually for some information-hiding reason. For example, you might need to store data in a POD (Plain Old Data) structure in order to store it to and from some binary file format. However, you don't want users of your class to access this directly.

Normally you'd put the declaration in an implementation file, but you might want to have a member variable of that type. To do this, the structure must be declared in the header, so you put it in a private area of the header.

At other times, you might want a parameter class. You might have a method on one class that requires a large number of parameters, many of which are optional (which probably means you've overloaded the method too heavily, but sometimes it's necessary). The Refactoring people suggest that you should replace the large number of parameters with a single parameter of a class type.

The class is only used in this one method, so to avoid polluting the namespace, you declare the parameter class inside the class in which it's used (obviously here you would declare it public or protected, depending on the scope of the method that uses it as a parameter.
GeneralRe: C++ Question. Pin
WREY21-Sep-03 9:55
WREY21-Sep-03 9:55 
GeneralRe: C++ Question. Pin
Anonymous21-Sep-03 1:19
Anonymous21-Sep-03 1:19 
GeneralRe: C++ Question. Pin
WREY21-Sep-03 9:23
WREY21-Sep-03 9:23 
GeneralWinsock WSANETWORKEVENTS Pin
mweiss20-Sep-03 9:26
mweiss20-Sep-03 9:26 
GeneralPop-up menu artifact Pin
Luis Mejia20-Sep-03 9:07
Luis Mejia20-Sep-03 9:07 
GeneralRegistry path from handle Pin
User 988520-Sep-03 7:55
User 988520-Sep-03 7:55 
GeneralRe: Registry path from handle Pin
David Crow20-Sep-03 17:01
David Crow20-Sep-03 17:01 
GeneralRe: Registry path from handle Pin
Jason Henderson20-Sep-03 17:54
Jason Henderson20-Sep-03 17:54 
GeneralProblem with Rich Edit Control Pin
raheela20-Sep-03 7:54
raheela20-Sep-03 7:54 
GeneralRe: Problem with Rich Edit Control Pin
Mike Dimmick20-Sep-03 12:54
Mike Dimmick20-Sep-03 12:54 
Generalproblem while using activeX control in regular dll using shared MFC DLL Pin
bhalchan20-Sep-03 5:57
bhalchan20-Sep-03 5:57 
Generalpassing data structures Pin
Sirrius20-Sep-03 5:09
Sirrius20-Sep-03 5:09 
GeneralRe: passing data structures Pin
Mike Dimmick20-Sep-03 12:59
Mike Dimmick20-Sep-03 12:59 
GeneralRe: passing data structures Pin
David Crow20-Sep-03 17:13
David Crow20-Sep-03 17:13 
GeneralRe: passing data structures Pin
Sirrius20-Sep-03 17:34
Sirrius20-Sep-03 17:34 
GeneralFile shredder Pin
alex.barylski20-Sep-03 4:58
alex.barylski20-Sep-03 4:58 
GeneralRe: File shredder Pin
JWood20-Sep-03 5:51
JWood20-Sep-03 5:51 

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.