Solved

Problem returning enum type

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

831 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