• ### Popular Now

• 13
• 14
• 27
• 9
• 9

#### Archived

This topic is now archived and is closed to further replies.

# SOS! what macro was defined in VC6,which show...?

This topic is 6315 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hey,All... I just wanna know--- Which macro(s) will be defined in the MFC project bringed by I use the AppWizard in VC6 to create a MFC project? and the function of the macro(s) is just to differentiate whether one project is MFC project or not,such as the macro WIN32 in one win32 program which show that the program is a win32 application,and NOT a win16 or the other type application. Why I wanna know it? Because now I have C++ source-code file,if the file inlcude to a MFC project,a header file stdafx.h must be included to the beginning of the file(as you have known,all the .CPP files within a MFC progecr must include the stdafx.h file),otherwise,it will occur a fault link error while attempting link the project; But for the non-MFC project(such as the win32 project),if inclde the file(stdafx.h) in it,it will occur a link error also(cannot find stdafx.h). Therefore if I know the macro(s),I can place the following lines to the beginning of the c++ source-code file:
#ifdef XXXXX // here,XXXXX is defined in MFC projects ONLY!
#include "stdafx.h"
#endif

Now,the c++ file can be used in the MFC or non-MFC project without any error! And the above XXXXX is what I wanna to know!! it will be ONLY defined in the MFC projects! Guy,can you tell me what is the XXXXX? Any help will be much welcome and thankful!!! Edited by - zhang_zhou on 11/30/00 7:59:25 AM

##### Share on other sites
Why don''t you check your documentation for predefined MACROS? I''m sure I came across a page with that info on it. At least, i think that''s what you''re trying to say. Sorry if I misunderstood your request.

##### Share on other sites
quote:
Original post by NuffSaid

Why don''t you check your documentation for predefined MACROS? I''m sure I came across a page with that info on it. At least, i think that''s what you''re trying to say. Sorry if I misunderstood your request.

Oh?! My documents?? I have ckecked it in ALL the documents relate it(including entire MSDN)! but,but,...sorry,I cannot find it really.

Can you tell me which document I should check in??

ThX again!

##### Share on other sites
Perhaps you refer to WIN32_LEAN_AND_MEAN ?
I could be mistaken.

// TIBERIA!?!?!

##### Share on other sites
quote:
Original post by Redleaf

Perhaps you refer to WIN32_LEAN_AND_MEAN ?
I could be mistaken.

// TIBERIA!?!?!

Hey,guy,NOT the WIN32_LEAN_AND_MEAN...

The function and usage of the WIN32_LEAN_AND_MEAN as the following(come from the article in MSDN ):
To speed the build process, Visual C++ provides the following defines that reduce the size of the Win32 header files. VC_EXTRALEANWIN32_LEAN_AND_MEAN Newly generated Visual C++ AppWizard applications automatically benefit from VC_EXTRALEAN. You can also manually define VC_EXTRALEAN to speed the build process of many legacy MFC applications. Non-MFC C++ and C applications can define WIN32_LEAN_AND_MEAN and any applicable NOservice defines, such as NOSOUND (see ProgramFiles\Microsoft Visual Studio\VC98\include\Windows.h and ProgramFiles\Microsoft Visual Studio\VC98\MFC\Include\afxv_w32.h), to reduce their build times.To add these defines, from the Project menu, choose Settings. The Projects settings dialog box appears. Click the C/C++ tab. In the Category list, select Preprocessor. Add the desired definitions to the Preprocessor Definitions box.

Thanks anyway

And anyone have the other opinion?

Anyone else?