Click here to Skip to main content
15,923,087 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: winsock error message Pin
Florin Ochiana27-Aug-03 20:30
Florin Ochiana27-Aug-03 20:30 
GeneralRe: winsock error message Pin
d_lite27-Aug-03 22:21
d_lite27-Aug-03 22:21 
Questionhow to convert string to CTime object? Pin
Habbit27-Aug-03 16:13
Habbit27-Aug-03 16:13 
AnswerRe: how to convert string to CTime object? Pin
Ravi Bhavnani27-Aug-03 19:33
professionalRavi Bhavnani27-Aug-03 19:33 
GeneralPre compiled Headers Pin
inrecovery27-Aug-03 14:12
inrecovery27-Aug-03 14:12 
GeneralRe: Pre compiled Headers Pin
Navin27-Aug-03 14:16
Navin27-Aug-03 14:16 
GeneralRe: Pre compiled Headers Pin
inrecovery27-Aug-03 14:25
inrecovery27-Aug-03 14:25 
GeneralRe: Pre compiled Headers Pin
Navin27-Aug-03 16:07
Navin27-Aug-03 16:07 
1.
I use the "Automatic" becuase every now and then a file I need won't have "#inclue stdafx.h" in it. "Automatic" simply means, if a CPP File has, say "#inclue stdafx.h" then it assumes it is using a precompiled header. If not, go on and compile the file 'normally'. This also means you never have to go file by file and set up precompiled header info - you just have one setting for the whole project. The way you're doing it will work though, I just have my own preference.

2.
I probably wouldn't put "using std;" in there simply because that defeats the whole purpose of having "std" in a namespace. Although I suppose it is a convenience issue, really, it won't hurt anything if you konw you will never have name clashes with any of the std stuff.

3. See the answer to 1.

4. As far as "pragma hdrstop", I've never seen that in VC code, I do remember using it in Borland C++ (ah, remember those days Smile | :) ). The only stuff that gets precompiled is what's in "stdafx.h" (AFAIK.)

5. Here's the kind of stuff I put in my stdafx.h (or equivilant):
Green Alien | [Alien] MFC and STL headers
Green Alien | [Alien] My own headers for stable classes that rarely change but are included a lot
Green Alien | [Alien] Any funky defines and such that should apply to every file in the project

It's a bad idea to have every header in your project in there, or to have one big header that includes everything. Two reasons:
Dead | X| It makes it very difficult to sort out components that you may someday move to another project or a common area.
Dead | X| If *any* include changes, you'll have to rebuild your WHOLE project.

I usually have one class per CPP/H pair. And just include whatever stuff is necessary when it is necessary. stdafx.h gets stuff that truly is common across all (or at least many) modules.



"When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute and it's longer than any hour. That's relativity." - Albert Einstein
GeneralRe: Pre compiled Headers Pin
Steve S27-Aug-03 22:55
Steve S27-Aug-03 22:55 
GeneralMicrosoft 'C' Compiler 6.00 Pin
C. Augusto Proiete27-Aug-03 13:35
C. Augusto Proiete27-Aug-03 13:35 
GeneralRe: Microsoft 'C' Compiler 6.00 Pin
Steve S27-Aug-03 22:49
Steve S27-Aug-03 22:49 
GeneralRe: Microsoft 'C' Compiler 6.00 Pin
C. Augusto Proiete28-Aug-03 3:39
C. Augusto Proiete28-Aug-03 3:39 
Generalpass complex data type from CMyapp to CMyDoc (std MFC stuf) Pin
Member 53141427-Aug-03 12:54
Member 53141427-Aug-03 12:54 
GeneralRe: pass complex data type from CMyapp to CMyDoc (std MFC stuf) Pin
Ravi Bhavnani27-Aug-03 13:12
professionalRavi Bhavnani27-Aug-03 13:12 
GeneralRe: pass complex data type from CMyapp to CMyDoc (std MFC stuf) Pin
Antti Keskinen16-Feb-04 3:04
Antti Keskinen16-Feb-04 3:04 
GeneralAssertion error at CDialog dereived class constructor Pin
Vassilis Papoulidis27-Aug-03 12:47
Vassilis Papoulidis27-Aug-03 12:47 
GeneralRe: Assertion error at CDialog dereived class constructor Pin
valikac27-Aug-03 12:51
valikac27-Aug-03 12:51 
GeneralRe: Assertion error at CDialog dereived class constructor Pin
Dave Bryant27-Aug-03 12:57
Dave Bryant27-Aug-03 12:57 
Generalkeybd_event question Pin
halblonious27-Aug-03 11:53
halblonious27-Aug-03 11:53 
QuestionWhat is a game engine?? Pin
Snyp27-Aug-03 10:09
Snyp27-Aug-03 10:09 
AnswerRe: What is a game engine?? Pin
Jim Crafton27-Aug-03 10:21
Jim Crafton27-Aug-03 10:21 
AnswerRe: What is a game engine?? Pin
Maximilien27-Aug-03 10:26
Maximilien27-Aug-03 10:26 
GeneralASSERT failure Pin
mr200327-Aug-03 9:13
mr200327-Aug-03 9:13 
GeneralRe: ASSERT failure Pin
David Crow27-Aug-03 9:53
David Crow27-Aug-03 9:53 
GeneralRe: ASSERT failure Pin
mr200327-Aug-03 10:11
mr200327-Aug-03 10:11 

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.