Jump to content
  • Advertisement

Archived

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

zhang_zhou

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

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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_EXTRALEAN
WIN32_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?

Share this post


Link to post
Share on other sites
There is a MACRO called _MFC_VER. Or was it MFC_VER without the _ before it?
This defined to the version of MFC on the compiler. I think that if you do not have MFC installed or you aren''t using MFC, this macro isn''t defined.

So there...... I think I finally understood your question.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!