I was creating one of the projects I am working with, this time with VS2010, just to find out that one of the inclusions in windows.h has a typedef INPUT that ran into the const const export line in the code that I already have.
//winuser.h(string: 5332)
typedef struct tagINPUT {
DWORD type;
union
{
MOUSEINPUT mi;
KEYBDINPUT ki;
HARDWAREINPUT hi;
};
} INPUT, *PINPUT, FAR* LPINPUT;
//foo.h
extern FOO_DLL_API const string INPUT;
Now I do not use INPUT in violation of .cpp (and I do not own most of the code), and trying to minimize the impact, I did the following:
//myfile.cpp
#include <foo.h>
namespace windowsLib {
# include <windows.h>
}
using namespace windowsLib;
This approach is working fine so far, but I wanted to ask you if you see potential problems with this approach or if you have a better suggestion.
Edit:
, . , , foo.h . , , , .
" ", ?
, , - .. , .
2:
, :
//stub.cpp
#include <windows.h>
//stub.h
class stub {
}
//myfile.cpp
#include <stub.h>
#include <foo.h>
, , . .