Results 1 to 6 of 6

Thread: stdafx.h & stuff inside

  1. #1

    Thread Starter
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394

    Smile 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,
    VS.NET 2003

    Need to email me?

  2. #2
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    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

  3. #3
    Lively Member FantastichenEin's Avatar
    Join Date
    Mar 2000
    Location
    dairy
    Posts
    106
    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
    ****

  4. #4
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    FantasticOne, thx, i didnt' know which headers were actually
    excluded
    Bababooey
    Tatatoothy
    Mamamonkey

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    #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.

  6. #6

    Thread Starter
    Hyperactive Member made_of_asp's Avatar
    Join Date
    Jul 2001
    Location
    123 Fake Street
    Posts
    394
    Thanks
    VS.NET 2003

    Need to email me?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width