views:

43

answers:

1

I have a program that doesn't seem to recognize declared types in the latest U3D software. There's a line

typedef BOOL (WINAPI* GMI)(HMON, LPMONITORINFOEX);

which gets the error:

Error 1 error C2061: syntax error : identifier 'LPMONITORINFOEX' c:\Projects\U3D\Source\RTL\Platform\Common\Win32\IFXOSRender.cpp 28

and a line

MONITORINFOEX miMon;

which gets

Error 5 error C2065: 'miMon' : undeclared identifier c:\Projects\U3D\Source\RTL\Platform\Common\Win32\IFXOSRender.cpp 49 Error 3 error C2065: 'MONITORINFOEX' : undeclared identifier c:\Projects\U3D\Source\RTL\Platform\Common\Win32\IFXOSRender.cpp 49

The program's first non-comment statement is #include <windows.h>, which includes winuser.h, which defines these identifiers. In Visual Studio, I can right-click on them and go to the definition (a typedef) and from the typedef to the struct. WINAPI is defined in WinDef.h, so that seems to be working. There are no redefinitions of LPMONITORINFOEX or MONITORINFOEX in any other file.

So, how can this be happening, and what can I do about it?

+1  A: 

My guess is something is up with your WINVER define. If you look at winuser.h, those are only defined in the block:

#if(WINVER >= 0x0500)

Is it possible that your WINVER is incorrectly set?

SB
Thank you very much - it was 0400. I've changed it, and the errors have gone away.
David Thornley