-1

Argh! This seems like a trivial thing to fix, but I can't figure out what I'm doing wrong...

I'm using VS2010, and I created a menu using the editor....right clicked on the menu item and clicked 'Add Event Handler'.....filled in all the necessary bits and pieces.

then when I go to compile it, it gives me this error messeage:

c:\users\alvin\documents\visual studio 2010\projects\emergence\emergence\emergenceview.cpp(30): error C2065: 'ID_MUTATE_GROUP' : undeclared identifier

Here is the relevant block of code:

BEGIN_MESSAGE_MAP(CEmergenceView, CRichEditView)
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, &CRichEditView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, &CRichEditView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, &CEmergenceView::OnFilePrintPreview)
ON_WM_CONTEXTMENU()
ON_WM_RBUTTONUP()
ON_COMMAND(ID_MUTATE_GROUP, &CEmergenceView::OnMutateGroup)
END_MESSAGE_MAP()

I have checked resource.h and ID_MUTATE_GROUP is defined there...

Please help!

user2361103
  • 97
  • 2
  • 12
  • There is a long and difficult obstacle course of search paths, conditional includes, old files, precompiled headers, stray preprocessor directives and who knows what else between your resource.h and line 30 of your program. To begin a diagnosis: what's the difference between ID_FILE_PRINT etc, which work, and ID_MUTATE_GROUP, which doesn't work? – Lorenzo Gatti Dec 20 '13 at 08:45
  • Thanks for replying....but I have solved the problem by including my resource.h in the header file for View.cpp – user2361103 Dec 20 '13 at 08:46
  • How can we be sure that resource.h is as you say? – David Heffernan Dec 20 '13 at 08:46
  • @David what do you mean? – user2361103 Dec 20 '13 at 08:48
  • I mean your question is incomplete. Just because you say the header file is fine, does not mean that it is. Without an SSCCE the question is pointless. – David Heffernan Dec 20 '13 at 08:51
  • possible duplicate of [What is an 'undeclared identifier' error and how do I fix it?](http://stackoverflow.com/questions/22197030/what-is-an-undeclared-identifier-error-and-how-do-i-fix-it) – sashoalm Mar 05 '14 at 13:33

1 Answers1

0

Simply needed to include Resource.h in EmergenceView.h and it complied perfectly :)

user2361103
  • 97
  • 2
  • 12
  • 1
    This is not the answer to the question that you asked. Since only you know all the details, this only has meaning to you. You didn't give us any of the detail of you source files. How could we know that you didn't include the header file. I suggest you just delete the question altogether. There's no need for Stack Exchange to keep this for perpetuity. – David Heffernan Dec 20 '13 at 08:53