|
-
Feb 15th, 2002, 07:03 AM
#1
Thread Starter
Hyperactive Member
stdafx.h & stuff inside
Hello,
what is #pragma once
what is #if !defined(AFX_STDAFX_H__535D0A00_A86C_40E5_BD32_76476085E127__INCLUDED_)
#define AFX_STDAFX_H__535D0A00_A86C_40E5_BD32_76476085E127__INCLUDED_
what's #define WIN32_LEAN_AND_MEAN
Thanks for any help,
-
Feb 15th, 2002, 07:31 AM
#2
Hyperactive Member
the #if !defined .... #define ....
simply tells the compiler not to define the header file again if it's
already defined once
WIN32_LEAN_AND_MEAN just loads the basic headers that one
needs to create a window without all the extra junk that you
probably wouldn't use. I'm not sure where exactly the line is
drawn as to what is loaded and what isn't..... CornedBee would
probably (definitely) know
i'm not sure what #pragma once means however.....CornedBee
again
Bababooey
Tatatoothy
Mamamonkey
-
Feb 15th, 2002, 08:56 AM
#3
Lively Member
Defining Lean and mean enures the following headers are not included:
<cderr.h>
<dde.h>
<ddeml.h>
<dlgs.h>
<lzexpand.h>
<mmsystem.h>
<nb30.h>
<rpc.h>
<shellapi.h>
<winperf.h>
<winsock2.h>
<mswsock.h>
<winsock.h>
<wincrypt.h>
Stuff that is not used often.
I assume the rest is to do with pre-compiled headers or mfc
-
Feb 15th, 2002, 09:50 AM
#4
Hyperactive Member
FantasticOne, thx, i didnt' know which headers were actually
excluded
Bababooey
Tatatoothy
Mamamonkey
-
Feb 15th, 2002, 01:13 PM
#5
#if, #elseif, #else, #endif, #ifdef and #ifndef
are the directives for conditional compilation. This can depend on the values of a constant (#if MSC_VER >= 1000), or the existance or non-existance of a constant (#if defined SOMENAME or #if !defined SOMENAME). #ifdef = #if defined, #ifndef = #if !defined.
constants are defined with
#define <NAME> [<value>]
You don't need a value, then it is called a symbol.
To avoid double include of header files, the following technique was developed:
1) check if a unique symbol is defined (#ifdef SOMEUNIQUESYMBOL)
2) if not, define it (#define SOMEUNIQUESYMBOL)
3) else ignore the content of the header file by placing the #endif at the end of the file
VC++ automatically generates a unique symbol by using this scheme:
AFX_<header name in capital letters>_H__<a GUID>__INCLUDED_
#pragma once
is a VC++ specific non-standard extension which does the same thing: if the preprocessor find a #pragma once, it saves the header file name. It ignores any further #include directives specifying this name in this module.
If you want to know what the headers exluded by LEAN_AND_MEAN do, search the forum for this constant, I explained it not long ago.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Feb 15th, 2002, 08:52 PM
#6
Thread Starter
Hyperactive Member
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|