Solved

Problem returning enum type

Posted on 1998-12-22
1
193 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying 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

In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
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 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 how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

705 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