Click here to Skip to main content
15,918,003 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionGetOpenFileName hangs Pin
andrew_dk3-Nov-07 12:31
andrew_dk3-Nov-07 12:31 
AnswerRe: GetOpenFileName hangs [modified] Pin
Peter Weyzen3-Nov-07 18:44
Peter Weyzen3-Nov-07 18:44 
GeneralRe: GetOpenFileName hangs Pin
andrew_dk3-Nov-07 19:57
andrew_dk3-Nov-07 19:57 
QuestionHeader files #include problem Pin
Oliver1233-Nov-07 11:10
Oliver1233-Nov-07 11:10 
AnswerRe: Header files #include problem Pin
David Crow3-Nov-07 11:56
David Crow3-Nov-07 11:56 
AnswerRe: Header files #include problem Pin
Bram van Kampen3-Nov-07 12:39
Bram van Kampen3-Nov-07 12:39 
GeneralRe: Header files #include problem Pin
Oliver1233-Nov-07 13:58
Oliver1233-Nov-07 13:58 
GeneralRe: Header files #include problem Pin
Peter Weyzen3-Nov-07 19:13
Peter Weyzen3-Nov-07 19:13 
Just to add a little more confusing detail:

If you just reference the object by pointer or reference (either inside the class data or in a function declaration) then you can get away with just a forward reference.

In these cases the size of the object is fixed -- the size of a pointer. And since you're not using the other class, it needs to know nothing about the functions in it...

If you declare an instance of class or override an class -- then you must include the header. In this case, the compiler needs to actually know something about the object to compile (like the size of the other class, what virtual functions it has, ... )

Sorry if this is a little confusing. The gist is -- don't include the header until the object is actually used. And always try to use a forward declaration.... if you can.

Oh, and always use "#pragma once" too




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>

GeneralRe: Header files #include problem Pin
Vaclav_4-Nov-07 5:30
Vaclav_4-Nov-07 5:30 
GeneralRe: Header files #include problem Pin
Peter Weyzen4-Nov-07 6:36
Peter Weyzen4-Nov-07 6:36 
GeneralRe: Header files #include problem Pin
Bram van Kampen4-Nov-07 11:49
Bram van Kampen4-Nov-07 11:49 
GeneralRe: Header files #include problem Pin
Bram van Kampen4-Nov-07 11:11
Bram van Kampen4-Nov-07 11:11 
GeneralRe: Header files #include problem Pin
Oliver1234-Nov-07 11:33
Oliver1234-Nov-07 11:33 
GeneralRe: Header files #include problem Pin
Bram van Kampen4-Nov-07 12:17
Bram van Kampen4-Nov-07 12:17 
GeneralRe: Header files #include problem Pin
Oliver1235-Nov-07 14:23
Oliver1235-Nov-07 14:23 
Question4 bit datatype? Pin
_NielsB3-Nov-07 8:56
_NielsB3-Nov-07 8:56 
AnswerRe: 4 bit datatype? Pin
David Crow3-Nov-07 11:55
David Crow3-Nov-07 11:55 
GeneralRe: 4 bit datatype? Pin
Bram van Kampen3-Nov-07 13:04
Bram van Kampen3-Nov-07 13:04 
QuestionChanging resource in a dll Pin
Imtiaz Murtaza3-Nov-07 8:14
Imtiaz Murtaza3-Nov-07 8:14 
AnswerRe: Changing resource in a dll Pin
Peter Weyzen3-Nov-07 18:58
Peter Weyzen3-Nov-07 18:58 
QuestionRemoving the scrollbars from a CFormView derived class Pin
Sternocera3-Nov-07 7:17
Sternocera3-Nov-07 7:17 
AnswerRe: Removing the scrollbars from a CFormView derived class Pin
Nelek4-Nov-07 21:36
protectorNelek4-Nov-07 21:36 
GeneralRe: Removing the scrollbars from a CFormView derived class Pin
Sternocera4-Nov-07 22:05
Sternocera4-Nov-07 22:05 
GeneralRe: Removing the scrollbars from a CFormView derived class Pin
Nelek4-Nov-07 23:48
protectorNelek4-Nov-07 23:48 
Questionflexgrid or any grid VC++ 2003 Pin
Rhymhoont3-Nov-07 6:30
Rhymhoont3-Nov-07 6:30 

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.