?
Solved

CWindowImpl problem - URGENT

Posted on 2001-06-13
6
Medium Priority
?
406 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
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

839 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