Solved

Problem returning enum type

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
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…
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.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

707 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

19 Experts available now in Live!

Get 1:1 Help Now