Not that anybody seems interested but I tried some different platform sdk releases based on the assumption that I must be the only person with this problem! :shock:
Basically all the platform sdk downloads still listed on microsoft.com exhibit the same problem. However, installations of VC6 and VC7.1 that come with (much older) platform sdk headers included do not have any problems. With all my tests I had the platform sdk headers in a separate folder to the compiler includes. ie, .\vc71\include + .\psdk\include.
PASS - (04/1998) VC6.0 SP6 Includes with PSDK
PASS - (09/2002) VC7.1 SP1 Includes with PSDK
FAIL - (05/2005) PlatformSDK Windows 2003 SP2
FAIL - (03/2006) PlatformSDK Windows 2003 R2
FAIL - (11/2006) PlatformSDK Windows Vista
I guess there must be some weird difference between the header layout wrt preprocessor directives or something... I can zip these up if anybody is interested...
Did you check inside the files for "strange" constructs or defines, around there the parser stops, that could possibly confuse our parser?
If you can't see anything, zip one such file and attach it here or post a link to it so I can have a look.
Thanks for looking into this, I've spent a while investigating and documenting this so a resolution may be found. Opening the attached project from testproj.zip with your psdk search path changed to the minimal set of headers included *should* result in the described behavoir. The other attachment has the working headers from VS2003 if required.
I've found the part of the include that causes the problem by commenting out various directives and retesting, I didn't think of doing this before as I thought disabling the 'Follow Preprocessor Directives' option should ignore any #ifdef etc. directives but it doesn't seem to have any effect on this issue - does the option only effect reading of additional files included in a header? Additionally, the directives look valid and folding within SciTe seems to confirm that.
The error occurs with incorrect parsing of the '#ifdef UNICODE' block within the '#if defined(_M_CEE)' blocks commented below. What's surprising is that I wouldn't expect the problem block to even be parsed based on the defines in effect. With the 'Follow Preprocessor Directives' option disabled the error still happens. Also, 'Find declaration of..' FormatMessage lists the symbol defined within this directive, should this be the case. It seems Codeblocks parses within inactive directives.
WinBase.h
#if defined(_M_CEE)
#undef FormatMessage
__inline
DWORD
FormatMessage(
DWORD dwFlags,
LPCVOID lpSource,
DWORD dwMessageId,
DWORD dwLanguageId,
LPTSTR lpBuffer,
DWORD nSize,
va_list *Arguments
)
{
/// COMMENTING THE FOLLOWING DIRECTIVE
/// MAKES THE PROBLEM GO AWAY!
/*
#ifdef UNICODE
return FormatMessageW(
#else
return FormatMessageA(
#endif
*/
dwFlags,
lpSource,
dwMessageId,
dwLanguageId,
lpBuffer,
nSize,
Arguments
);
}
#endif /* _M_CEE */
WinUser.h
#if defined(_M_CEE)
#undef GetMessage
__inline
BOOL
GetMessage(
LPMSG lpMsg,
HWND hWnd,
UINT wMsgFilterMin,
UINT wMsgFilterMax
)
{
/// COMMENTING THE FOLLOWING DIRECTIVE
/// MAKES THE PROBLEM GO AWAY!
/*
#ifdef UNICODE
return GetMessageW(
#else
return GetMessageA(
#endif
*/
lpMsg,
hWnd,
wMsgFilterMin,
wMsgFilterMax
);
}
#endif /* _M_CEE */
Commenting out the blocks above doesn't completely fix code completion, for instance 'MessageBox' is not found so there are other instances of this problem within the same include. However, some similar directives I look into don't seem to cause the same problem. The following block for 'SetEnvironmentVariable' within 'WinBase.h' seems ok so there seems to be some other influence at work here:
WinBase.h
#if defined(_M_CEE)
#undef SetEnvironmentVariable
__inline
BOOL
SetEnvironmentVariable(
LPCTSTR lpName,
LPCTSTR lpValue
)
{
/// THE FOLLOWING DIRECTIVE DOESN'T
/// SEEM TO CAUSE A PROBLEM...
#ifdef UNICODE
return SetEnvironmentVariableW(
#else
return SetEnvironmentVariableA(
#endif
lpName,
lpValue
);
}
#endif /* _M_CEE */
But then again you may ignore this post as I don't have 10000 posts already so it may very well be considered invalid...
Ha! Then I am lucky your post count is not so high yet! Of course your post is valid - to me anyway - you still have more posts than I do!!! ;)
I'm joking btw, although it does annoy me how many boards have a snobery regarding post count. Especially as I prefer to search for my own answers rather than increasing my post count by blindly asking for help all the time! End Rant! :P
Jamie
[attachment deleted by admin]