• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

Problem returning enum type

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.
1 Solution
TreeNodeType CRDOTreeView::GetNodeType(HTREEITEM hTreeItem) const
CRDOTreeView::TreeNodeType CRDOTreeView::GetNodeType(HTREEITEM hTreeItem) const

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

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now