Solved

Problem returning enum type

Posted on 1998-12-22
1
192 Views
Last Modified: 2012-05-04
With the following declaration:

class CRDOTreeView
{
    ...
    enum TreeNodeType { ROOT, PAGE, IMAGE };
    TreeNodeType GetNodeType(HTREEITEM hTreeItem) const;
    ...
};

and the following implementation:

TreeNodeType CRDOTreeView::GetNodeType(HTREEITEM hTreeItem) const
{
    return PAGE;
}

I get the following compiler errors:

D:\dev\projects\RDOAPISample\RDOTreeView.cpp(313) : error C2143: syntax
error : missing ';' before 'tag::id'
D:\dev\projects\RDOAPISample\RDOTreeView.cpp(313) : error C2501:
'TreeNodeType' : missing storage-class or type specifiers
D:\dev\projects\RDOAPISample\RDOTreeView.cpp(313) : fatal error C1004:
unexpected end of file found

Can someone shed some light on this for me?  Thanks.
--
Mike
0
Comment
Question by:mpatter
[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
1 Comment
 
LVL 8

Accepted Solution

by:
MaDdUCK earned 50 total points
ID: 1180867
change
TreeNodeType CRDOTreeView::GetNodeType(HTREEITEM hTreeItem) const
to
CRDOTreeView::TreeNodeType CRDOTreeView::GetNodeType(HTREEITEM hTreeItem) const

since you declared the enum type inside the class, you need to resolve the namespace properly.

0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

730 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