BEGIN_MESSAGE_MAP - not recognized [message #653312] |
Wed, 09 February 2011 10:28 |
Wolfgang Messages: 4 Registered: February 2011 |
Junior Member |
|
|
a block like
BEGIN_MESSAGE_MAP(Proc1, Proc2)
END_MESSAGE_MAP()
is indicated with "syntax error" and the immediate following method is neither shown in the outline-view nor found in a search based on the indexer.
How could I tell CDT to ignore such blocks or to accept the syntax (which is correct for MS Visual Studio 2005)?
regards Wolfgang
[Updated on: Wed, 09 February 2011 10:29] Report message to a moderator
|
|
|
|
Re: BEGIN_MESSAGE_MAP - not recognized [message #654101 is a reply to message #653408] |
Mon, 14 February 2011 08:27 |
Wolfgang Messages: 4 Registered: February 2011 |
Junior Member |
|
|
It's no compiler generated "warning" but an eclipse warning.
Therefore defining BEGIN / END_MESSAGE_MAP as empty macros in C++ settings in the "Paths and Symbols" section didn't change anything.
The BEGIN / END_MESSAGE_MAP block is still marked with a "Syntax error" warning (an orange "?" besides the line number) and much more important the immediate following method isn't recognized by the eclipse parser and can't be found by a C-Search.
[Updated on: Mon, 14 February 2011 08:30] Report message to a moderator
|
|
|
Re: BEGIN_MESSAGE_MAP - not recognized [message #654427 is a reply to message #654101] |
Tue, 15 February 2011 16:55 |
John McCabe Messages: 228 Registered: July 2009 |
Senior Member |
|
|
On Mon, 14 Feb 2011 09:28:05 +0100, Wolfgang
<wolfgang.schaeuble@ubs.com> wrote:
>It's no compiler generated "warning" but an eclipse warning.
>
>Therefore defining BEGIN / END_MESSAGE_MAP as empty macros in C++ settings in the "Paths and Symbols" section didn't change anything.
>
>The BEGIN / END_MESSAGE_MAP block is still marked with a "Syntax error" warning (an orange "?" besides the line number) and much more important the imediate following method isn't recognized by the eclipse parser and can't be found by a C-Search.
The problem really is that BEGIN/END_MESSAGE_MAP, and its associated
DECLARE_MESSAGE_MAP are macros that expand to fairly 'interesting'
pieces of code, all of which are Microsoft specific (which can cause
issues in Eclipse because, unless the latest version (8.0 or so) is
better, isn't really supported in Eclipse.
FWIW - afxwin.h has code that defined BEGIN_MESSAGE_MAP,
END_MESSAGE_MAP and DECLARE_MESSAGE_MAP, perhaps adding the path to
afxwin.h in your Paths and Symbols section may help. On my system it's
in C:\Program Files\Microsoft Visual Studio .NET\Vc7\atlmfc\include.
You may have to declare some other bits and pieces too though,
|
|
|
|
|
Re: BEGIN_MESSAGE_MAP - not recognized (solved) [message #654602 is a reply to message #653312] |
Wed, 16 February 2011 13:18 |
Wolfgang Messages: 4 Registered: February 2011 |
Junior Member |
|
|
Thank you very much for your useful hints.
A long time ago I had put
c:\program files\microsoft visual studio 8\vc\atlmfc\include (MS Visual Studio v. 8 )
under "Path and Symbols" - "Includes", but only for Language "Assembly" and even not in all configurations.
Thus afxwin.h (containing BEGIN_MESSAGE_MAP etc.) was not found (e.g. after F3 OpenDeclaration).
Now after I've added the include path above to all Languages (and maybe not necessary for all configurations) the parser recognized the immediate following method as expected.
So now I can search for all methods with C++-Search (really great, - it was the main issue I had!!!).
And yes the macros now are resolved (they were not before).
There is still an orange "?" (Syntax error) at the left besides "BEGIN_MESSAGE_MAP (...)" and "END_MESSAGE_MAP ()", but this is no isssue for me, because it has no implication other than the visible "?".
I could fix it by surrounding the code with
#ifndef __CDT_PARSER__
BEGIN_MESSAGE_MAP(...)
END_MESSAGE_MAP()
#endif
So in my view this topic is solved!
Again thanks and regards
Wolfgang
[Updated on: Wed, 16 February 2011 13:20] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.05344 seconds