Hello, first of all let me say that I do know that it's not possible to undefine a typedef as I already did a search in that direction.
Now to my problem:
I have a rather old application (not programmed by myself) which uses precompiled headers, the MFC libary and DirectX 6 (with the d3drm libary).
These are the contents of stdafx.h:
1 2 3 4 5 6 7
|
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include "appincludes.h"
|
then appincludes.h includes the d3drm header files
1 2
|
#include <d3drm.h>
#include <d3drmdef.h>
|
The problem with that is that afxwin.h includes among other things
d2dbasetypes.h
which typedefs D3DCOLORVALUE
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#ifndef D3DCOLORVALUE_DEFINED
//+-----------------------------------------------------------------------------
//
// Struct:
// D3DCOLORVALUE
//
//------------------------------------------------------------------------------
typedef struct D3DCOLORVALUE
{
FLOAT r;
FLOAT g;
FLOAT b;
FLOAT a;
} D3DCOLORVALUE;
#define D3DCOLORVALUE_DEFINED
#endif
|
however this conflicts afterwards with the d3drm headers because those include
d3dtypes.h
which typedef again D3DCOLORVALUE:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
typedef struct _D3DCOLORVALUE {
union {
D3DVALUE r;
D3DVALUE dvR;
};
union {
D3DVALUE g;
D3DVALUE dvG;
};
union {
D3DVALUE b;
D3DVALUE dvB;
};
union {
D3DVALUE a;
D3DVALUE dvA;
};
} D3DCOLORVALUE, *LPD3DCOLORVALUE;
|
and including the d3drm headers before including afxwin.h is impossible because he then cancels with the error
fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
So I hope anybody can give me some help to solve this problem because I have no idea how to do it :-P