Click here to Skip to main content
16,007,885 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHooking Question. Am I Dumb? Pin
RickGavin16-Jan-03 4:17
RickGavin16-Jan-03 4:17 
AnswerRe: Hooking Question. Am I Dumb? Pin
jmkhael16-Jan-03 6:06
jmkhael16-Jan-03 6:06 
GeneralBitmap and dialogbar Pin
MemLeak16-Jan-03 3:09
MemLeak16-Jan-03 3:09 
Generallocation of #include statements Pin
ns16-Jan-03 3:05
ns16-Jan-03 3:05 
GeneralRe: location of #include statements Pin
Maximilien16-Jan-03 3:11
Maximilien16-Jan-03 3:11 
GeneralRe: location of #include statements Pin
ns16-Jan-03 3:15
ns16-Jan-03 3:15 
GeneralRe: location of #include statements Pin
blackmesa16-Jan-03 7:29
blackmesa16-Jan-03 7:29 
GeneralRe: location of #include statements Pin
Maximilien16-Jan-03 8:31
Maximilien16-Jan-03 8:31 
To remove the dependencies of objects.

if in class A I have an Object O and is declared directly in the class declaration, I need to have the #include for it in the .h file.

// a.h
#include "O.h"
class A 
{
 O m_o;
};


so, everytime that O changes ( the file is changed ) , a.cpp. and every other files that include a.h will be recompiled.

but if I have
//a.h
class O;
class A
{
 O* m_pO;
};



there's no dependencies in the .h file.

For small projects, it's not that important whether you put #include in the .h files, but for large projects, is can be costly.

See Large Scale C++ Software Design[^] by John Lakos, and in particular section 6.1.

Max.
GeneralRendering HTML Pin
Jamie Hale16-Jan-03 2:53
Jamie Hale16-Jan-03 2:53 
GeneralRe: Rendering HTML Pin
Joel Lucsy16-Jan-03 3:19
Joel Lucsy16-Jan-03 3:19 
GeneralRe: Rendering HTML Pin
Jamie Hale16-Jan-03 3:32
Jamie Hale16-Jan-03 3:32 
GeneralRe: Rendering HTML Pin
Joel Lucsy16-Jan-03 14:56
Joel Lucsy16-Jan-03 14:56 
GeneralRe: Rendering HTML Pin
Jamie Hale17-Jan-03 2:31
Jamie Hale17-Jan-03 2:31 
GeneralRe: Rendering HTML Pin
Anna-Jayne Metcalfe16-Jan-03 4:42
Anna-Jayne Metcalfe16-Jan-03 4:42 
GeneralRe: Rendering HTML Pin
Jamie Hale16-Jan-03 4:47
Jamie Hale16-Jan-03 4:47 
Questionhow can i set a binary or a DWORD value to a new Registry Key? Pin
vijayjss16-Jan-03 2:46
vijayjss16-Jan-03 2:46 
AnswerRe: how can i set a binary or a DWORD value to a new Registry Key? Pin
AlexO16-Jan-03 3:20
AlexO16-Jan-03 3:20 
QuestionHow can I know if the app is running from a server ?? Pin
Cris16-Jan-03 2:45
Cris16-Jan-03 2:45 
AnswerClarify Pin
AlexO16-Jan-03 4:34
AlexO16-Jan-03 4:34 
GeneralRe: Clarify Pin
Cris16-Jan-03 4:51
Cris16-Jan-03 4:51 
GeneralRe: Clarify Pin
Erik Juhl16-Jan-03 4:57
Erik Juhl16-Jan-03 4:57 
GeneralRe: Clarify Pin
Anonymous16-Jan-03 4:58
Anonymous16-Jan-03 4:58 
GeneralRe: Clarify Pin
Cris16-Jan-03 5:15
Cris16-Jan-03 5:15 
GeneralRe: Clarify Pin
16-Jan-03 5:16
suss16-Jan-03 5:16 
GeneralRe: Clarify Pin
Cris16-Jan-03 5:46
Cris16-Jan-03 5:46 

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.