Solved

CWindowImpl problem - URGENT

Posted on 2001-06-13
6
382 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
6 Comments
 

Expert Comment

by:NickAtBOM
Comment Utility
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
Comment Utility
Nick is absolutely right
0
 
LVL 22

Expert Comment

by:ambience
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 

Author Comment

by:shederman
Comment Utility
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 200 total points
Comment Utility
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
Comment Utility
Bloody hell, I feel like an idiot. Thanks!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now