views:

138

answers:

2

For a static Win32 library, how can I detect that any of the "Use MFC" options is set?

i.e.

#ifdef ---BuildingForMFC---
....
#else
...
#endif
A: 

The symbol _AFX is typically defined for MFC projects.

1800 INFORMATION
I thought so muhc, too, but when enabling "Use MFC in a dynamic library" for a Win32 Library project (that was created without 'MFC support' option), this macro is not defined.
peterchen
+5  A: 

I have always checked for the symbol _MFC_VER being defined.

This is the version number of MFC being used 0x0700 = 7.0

It is in the "Predefined Macros" in MSDN

Bruce Ikin