Click here to Skip to main content
15,900,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Calling a Dialog from one .DSP which is Residing in Another .DSP of a same WorkSpace (.dsw) Pin
Rage5-Nov-06 22:39
professionalRage5-Nov-06 22:39 
GeneralRe: Calling a Dialog from one .DSP which is Residing in Another .DSP of a same WorkSpace (.dsw) Pin
uday kiran janaswamy5-Nov-06 23:00
uday kiran janaswamy5-Nov-06 23:00 
Questionerror C2664: 'strcpy' : cannot convert parameter 1 from 'union tagCY' to 'char *' Pin
With_problem5-Nov-06 18:21
With_problem5-Nov-06 18:21 
AnswerRe: error C2664: 'strcpy' : cannot convert parameter 1 from 'union tagCY' to 'char *' Pin
Waldermort5-Nov-06 18:25
Waldermort5-Nov-06 18:25 
AnswerRe: error C2664: 'strcpy' : cannot convert parameter 1 from 'union tagCY' to 'char *' Pin
Parthi_Appu5-Nov-06 18:27
Parthi_Appu5-Nov-06 18:27 
AnswerRe: error C2664: 'strcpy' : cannot convert parameter 1 from 'union tagCY' to 'char *' Pin
Nibu babu thomas5-Nov-06 18:32
Nibu babu thomas5-Nov-06 18:32 
AnswerRe: error C2664: 'strcpy' : cannot convert parameter 1 from 'union tagCY' to 'char *' Pin
Hamid_RT5-Nov-06 19:33
Hamid_RT5-Nov-06 19:33 
AnswerRe: error C2664: 'strcpy' : cannot convert parameter 1 from 'union tagCY' to 'char *' Pin
David Crow6-Nov-06 4:36
David Crow6-Nov-06 4:36 
QuestionInsert data Pin
With_problem5-Nov-06 17:26
With_problem5-Nov-06 17:26 
QuestionOpenPrinter error Pin
Archyami5-Nov-06 17:09
Archyami5-Nov-06 17:09 
AnswerRe: OpenPrinter error Pin
Waldermort5-Nov-06 18:11
Waldermort5-Nov-06 18:11 
AnswerRe: OpenPrinter error Pin
Hamid_RT5-Nov-06 18:39
Hamid_RT5-Nov-06 18:39 
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
professional#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
professional#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 

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.