Results 1 to 8 of 8

Thread: #define WIN32_LEAN_AND_MEAN and stdafx

  1. #1

    Thread Starter
    Lively Member FantastichenEin's Avatar
    Join Date
    Mar 2000
    Location
    dairy
    Posts
    106

    #define WIN32_LEAN_AND_MEAN and stdafx

    Hi,

    What does the #define WIN32_LEAN_AND_MEAN define mean?
    What will happen if I add this.

    Also, what does the stdafx header file do, will it produce pre compiled headers for all the headers included in stdafx?
    Also, why the afx part of the name?

    Many thanks
    ****

  2. #2
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    It shouldn't have any effect on the final executable size, but it speeds up compilation by excluding stuff you don't really need.

    stdafx.h was originally added into the MFC projects for the precompiled headers, but then in VC++6 they put it in all the projects.

    PCH can seriously speed up compilation, but if you change the PCH header you have to recompile everything.

    AFX == MFC. Don't know what it means, probably Application Effects or something
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    see this extract from windows.h:
    Code:
    #ifndef WIN32_LEAN_AND_MEAN
    #include <cderr.h>
    #include <dde.h>
    #include <ddeml.h>
    #include <dlgs.h>
    #ifndef _MAC
    #include <lzexpand.h>
    #include <mmsystem.h>
    #include <nb30.h>
    #include <rpc.h>
    #endif
    #include <shellapi.h>
    #ifndef _MAC
    #include <winperf.h>
    
    #if(_WIN32_WINNT >= 0x0400)
    #include <winsock2.h>
    #include <mswsock.h>
    #else
    #include <winsock.h>
    #endif /* _WIN32_WINNT >=  0x0400 */
    
    #endif /* WIN32_LEAN_AND_MEAN
    and from these headers:
    cderr.h - Common dialog error return codes
    dde.h - Dynamic Data Exchange structures and definitions
    ddeml.h - DDEML API header file (dynamic data exchange)
    dlgs.h - This module contains the UI dialog header information.
    lzdos.h - Public interface to LZEXP?.LIB. (data decompression library)
    mmsystem.h -- Include file for Multimedia API's
    nb30.h - This module contains the definitions for portable NetBIOS 3.0 support.
    rpc.h - Master include file for RPC applications. (Microsoft Remote Procedure Call)
    shellapi.h - SHELL.DLL functions, types, and definitions
    winperf.h - Header file for the Performance Monitor data.
    Winsock2.h -- definitions to be used with the WinSock 2 DLL
    mswsock.h - This module contains the Microsoft-specific extensions to the Windows Sockets API.
    Quite a lot

    AFX means application frameworks and was probably the developing name of MFC.
    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.

  4. #4

    Thread Starter
    Lively Member FantastichenEin's Avatar
    Join Date
    Mar 2000
    Location
    dairy
    Posts
    106
    Thanks for the help guys,

    I am having many difficulties moving from C on Unix to C++ windows. It's all these things that MS decide to add in for themselves, but it just seems to complicate in a lot of circumstances.
    ****

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    You won't get far in a GUI environment with the standard library only.
    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
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    MFC isn't required for writing windows programs. There are considerably better Standard Library-based methods of doing it (I'm currently working on one with the possibility of integrating it with what Kedaman's doing, hopefully in a cross-platform way).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  7. #7

    Thread Starter
    Lively Member FantastichenEin's Avatar
    Join Date
    Mar 2000
    Location
    dairy
    Posts
    106
    I have started using wxWindows, seems to do the job ok.
    I havn't even touched MFC, been on a course on it, but the instructor basically said it was crap.
    ****

  8. #8
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    wxWindows does look good, especially when you get onto cross-platform development (I noticed how it looks very like MFC, but people like it more...hmmm).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

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