Click here to Skip to main content
15,888,527 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralOwner drawn status bar and the sizegrip [modified] Pin
PJ Arends5-Nov-06 16:09
professionalPJ Arends5-Nov-06 16:09 
GeneralRe: Owner drawn status bar and the sizegrip Pin
Nibu babu thomas5-Nov-06 18:15
Nibu babu thomas5-Nov-06 18:15 
GeneralRe: Owner drawn status bar and the sizegrip Pin
Waldermort5-Nov-06 18:21
Waldermort5-Nov-06 18:21 
GeneralRe: Owner drawn status bar and the sizegrip Pin
PJ Arends5-Nov-06 21:51
professionalPJ Arends5-Nov-06 21:51 
QuestionFTP REST command Pin
rayong5-Nov-06 6:53
rayong5-Nov-06 6:53 
AnswerRe: FTP REST command Pin
kakan5-Nov-06 19:21
professionalkakan5-Nov-06 19:21 
GeneralRe: FTP REST command Pin
rayong5-Nov-06 22:23
rayong5-Nov-06 22:23 
QuestionVS2005 Preprocessor quirks [modified] Pin
#realJSOP5-Nov-06 3:41
mve#realJSOP5-Nov-06 3:41 
Using VS2005...

[EDIT #2]

Nevermind - caused by stupid programmer tricks...

[/EDIT #2]

I have a non-MFC DLL that checks _MSC_VER and _MFC_VER to conditionally compile the code. This seems to work just fine.

HOWEVER, I also have a MFC app that uses the same code, but the compiler seems to ignore those two preprocessor definitions. Here's the code in question:

#ifndef _MFC_VER
	#include <windows.h>
	#include <stdio.h>
	#include <crtdbg.h>
	#include <tchar.h>
	#if _MSC_VER < 1400
		#define TRACE ((void)0)
	#else
		#define TRACE ((void)__noop)
	#endif
	#pragma message("    compiling for Win32")
#else
	#include "stdafx.h"
	#pragma message("    compiling for MFC")
#endif


In the MFC app, the block contained within #ifndef _MFC_VER is active instead of the #else block. As an experiment, I inserted #define _MFC_VER 8.00 above the code you see there, and the #else block became active. Despite the fact that the first block is inactive, the compiler still appears to process the code within the #ifndef _MFC_VER block, generating errors about unexpected endif's and warnings about duplicate TRACE macro definitions.

Does anyone know how to resolve this?


[EDIT]

I moved the following code out of the outermost #ifdef, and that resolved the duplicate definition warning regarding the TRACE macro:

#if _MSC_VER < 1400
    #define TRACE ((void)0)
#else
    #define TRACE ((void)__noop)
#endif


However, the compiler still doesn't seem to see the _MFC_VER macro at all, and the compiler is still puking out errors regarding unexpected #endif's...





-- modified at 10:25 Sunday 5th November, 2006


-- modified at 10:32 Sunday 5th November, 2006


-- modified at 10:33 Sunday 5th November, 2006


"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001


AnswerRe: VS2005 Preprocessor quirks Pin
Sceptic Mole5-Nov-06 8:17
Sceptic Mole5-Nov-06 8:17 
GeneralRe: VS2005 Preprocessor quirks Pin
#realJSOP5-Nov-06 23:52
mve#realJSOP5-Nov-06 23:52 
AnswerRe: Modal floating controlbar Pin
Nibu babu thomas5-Nov-06 18:12
Nibu babu thomas5-Nov-06 18:12 
GeneralRe: Modal floating controlbar Pin
Nibu babu thomas13-Nov-06 21:22
Nibu babu thomas13-Nov-06 21:22 
GeneralRe: Modal floating controlbar Pin
Nibu babu thomas14-Nov-06 16:26
Nibu babu thomas14-Nov-06 16:26 
QuestionRussian Project [modified] Pin
Hadi Dayvary4-Nov-06 23:59
professionalHadi Dayvary4-Nov-06 23:59 
AnswerRe: Russian Project Pin
A_Fa5-Nov-06 0:10
A_Fa5-Nov-06 0:10 
AnswerRe: Russian Project Pin
Waldermort5-Nov-06 0:11
Waldermort5-Nov-06 0:11 
GeneralRe: Russian Project Pin
Hadi Dayvary5-Nov-06 0:44
professionalHadi Dayvary5-Nov-06 0:44 
GeneralRe: Russian Project Pin
Waldermort5-Nov-06 1:29
Waldermort5-Nov-06 1:29 
QuestionCalculating free space Pin
Waldermort4-Nov-06 22:42
Waldermort4-Nov-06 22:42 
AnswerRe: Calculating free space [modified] Pin
Stephen Hewitt5-Nov-06 11:47
Stephen Hewitt5-Nov-06 11:47 
GeneralRe: Calculating free space Pin
Waldermort5-Nov-06 18:09
Waldermort5-Nov-06 18:09 
GeneralRe: VC++8 (VS2005) Deriving class w/ wizard Pin
jeffbeat4-Nov-06 21:00
jeffbeat4-Nov-06 21:00 
QuestionVC++8 (VS2005) Deriving class w/ wizard Pin
jeffbeat4-Nov-06 19:26
jeffbeat4-Nov-06 19:26 
AnswerRe: VC++8 (VS2005) Deriving class w/ wizard Pin
Midworld084-Nov-06 20:27
Midworld084-Nov-06 20:27 
QuestionODBC &amp; FOR XML expilicit command [modified] Pin
canerabali4-Nov-06 14:34
canerabali4-Nov-06 14:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.