Click here to Skip to main content
15,916,693 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Closing windows Pin
ThatsAlok21-Sep-05 19:03
ThatsAlok21-Sep-05 19:03 
Questionwebbrowser & internet explorer Pin
RaymondM21-Sep-05 7:27
RaymondM21-Sep-05 7:27 
QuestionDHTML Edit Pin
jianxin080521-Sep-05 6:58
jianxin080521-Sep-05 6:58 
Questionhow to find dependencies Pin
Eytukan21-Sep-05 6:51
Eytukan21-Sep-05 6:51 
Answeri tried in "Bulid->start debug->go" Pin
Eytukan21-Sep-05 6:55
Eytukan21-Sep-05 6:55 
GeneralUse Dependency Walker Pin
Rob Caldecott21-Sep-05 6:57
Rob Caldecott21-Sep-05 6:57 
GeneralRe: Use Dependency Walker Pin
Eytukan21-Sep-05 7:03
Eytukan21-Sep-05 7:03 
GeneralRe: Use Dependency Walker Pin
David Crow21-Sep-05 9:36
David Crow21-Sep-05 9:36 
QuestionSHGetFileInfo - how to index of default folder icon Pin
Ian Bowler21-Sep-05 6:20
Ian Bowler21-Sep-05 6:20 
AnswerRe: SHGetFileInfo - how to index of default folder icon Pin
Shog921-Sep-05 6:32
sitebuilderShog921-Sep-05 6:32 
GeneralRe: SHGetFileInfo - how to index of default folder icon Pin
Ian Bowler21-Sep-05 6:36
Ian Bowler21-Sep-05 6:36 
GeneralRe: SHGetFileInfo - how to index of default folder icon Pin
Shog921-Sep-05 6:44
sitebuilderShog921-Sep-05 6:44 
QuestionInstall Project Pin
el_dude21-Sep-05 6:17
sussel_dude21-Sep-05 6:17 
QuestionVisual C++ Problem Pin
Anonymous21-Sep-05 6:09
Anonymous21-Sep-05 6:09 
QuestionThe C++ function to create an instance given a class name. Pin
Member 139789321-Sep-05 5:58
Member 139789321-Sep-05 5:58 
AnswerRe: The C++ function to create an instance given a class name. Pin
Cedric Moonen21-Sep-05 6:08
Cedric Moonen21-Sep-05 6:08 
AnswerRe: The C++ function to create an instance given a class name. Pin
Nemanja Trifunovic21-Sep-05 6:12
Nemanja Trifunovic21-Sep-05 6:12 
AnswerRe: The C++ function to create an instance given a class name. Pin
Chris Losinger21-Sep-05 6:18
professionalChris Losinger21-Sep-05 6:18 
AnswerRe: The C++ function to create an instance given a class name. Pin
Shog921-Sep-05 6:21
sitebuilderShog921-Sep-05 6:21 
QuestionStandard for inlining code Pin
Rob Caldecott21-Sep-05 4:47
Rob Caldecott21-Sep-05 4:47 
AnswerRe: Standard for inlining code Pin
Cedric Moonen21-Sep-05 4:54
Cedric Moonen21-Sep-05 4:54 
GeneralRe: Standard for inlining code Pin
Rob Caldecott21-Sep-05 4:59
Rob Caldecott21-Sep-05 4:59 
AnswerRe: Standard for inlining code Pin
Blake Miller21-Sep-05 5:09
Blake Miller21-Sep-05 5:09 
AnswerRe: Standard for inlining code Pin
Nemanja Trifunovic21-Sep-05 5:15
Nemanja Trifunovic21-Sep-05 5:15 
AnswerRe: Standard for inlining code Pin
Roger Stoltz21-Sep-05 5:56
Roger Stoltz21-Sep-05 5:56 
I've never heard or read about a MSFT policy regarding how inline member functions should be declared, but I suspect that it's due to readability reasons. Like Nemanja said "separating the interface from the implementation" in order not to clutter the interface and make it hard to read.

Regarding the syntax of the language there is nothing wrong with defining the member function in the class definition. It would make the function inline implicitly as Blake said.

In order for clients to use the inline function, the definition has to be included to make it possible for the compiler to extract the body in place. The most straight forward way to accomplish this is by have the definition in the header file. As I understand it the compiler does the same thing regardless of whether the function was defined inside the class definition or not.

Sometimes in MFC code, e.g. CDocument::GetDocument, the debug version of the function is not inline in order to step into the function. Otherwise one has to step through the assembler code to know what happens.
To write the preprocessor directive (#ifdef _DEBUG) inside the class definition wouldn't be a very beautiful code to look at for my eyes. Dead | X|
But that's a matter of taste and the compiler doesn't seems to have any.Laugh | :laugh:

--
Roger

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.