[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

CWindowImpl problem - URGENT

Posted on 2001-06-13
6
Medium Priority
?
404 Views
Last Modified: 2010-08-05
Hi, I'm trying to implement CWindowImpl on my class CMenus, here is a simplified declaration:

CMenus: ..., public CWindowImpl<CMenus> {
BEGIN_MSG_MAP(CMenus)
  MESSAGE_HANDLER(WM_MEASUREITEM, OnMeasureItem)
END_MSG_MAP

LRESULT OnMeasureItem(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
  // TODO : Add Code for message handler. Call    
     DefWindowProc if necessary.
  return 0;
}

This code gives me the error "fatal error C1075: end of file found before the left brace '{' at 'c:\dev\menus\menus.h(28)' was matched"

menus.h(28) is the line
BEGIN_MSG_MAP(CMenus)

What am I doing wrong here? If I don't get this right ASAP, I'm going to have to implement subclassing myself, and I'd rather use the ATL implementation.
0
Comment
Question by:shederman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Expert Comment

by:NickAtBOM
ID: 6184972
The code you have posted here needs an additional right brace on the last line - you open braces for the class definition on line 1 but never close again.  

If this is not the correct answer, can you post the full code?
0
 

Expert Comment

by:SusanneJost
ID: 6188677
Nick is absolutely right
0
 
LVL 22

Expert Comment

by:ambience
ID: 6189479
menus.h(28) is the line
BEGIN_MSG_MAP(CMenus)

>>> Something has gone wrong before that line , it can't be the right brace that you are missing on the last line in the post.

C1075: The compiler expected to find a matching brace before it reached the end of your source file but was unable to. Check whether your open brackets (and other paired characters such as curly braces) match with close brackets.

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:shederman
ID: 6189653
I don't think the problem is actually unmatched braces. If I take out the CWindomImpl<CMenus> inheritance, and remove the MSG_MAP the program compiles perfectly.
0
 

Accepted Solution

by:
NickAtBOM earned 800 total points
ID: 6189846
Just spotted another typo.  Try putting

END_MSG_MAP()  // i.e. with brackets

If it is not the brace at the end of the class, then it suggests that one of the two braces opened by the BEGIN_MSG_MAP(class) macro have not been closed.
0
 

Author Comment

by:shederman
ID: 6189889
Bloody hell, I feel like an idiot. Thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question