Solved

URGENT: Simple Header problem

Posted on 2003-10-25
1
231 Views
Last Modified: 2010-04-01
I can't figure out why I this doesn't work:

in my header file:

enum mapi_TFolderType {mftInbox,mftOutbox,mftSent,mftDeleted,mftCalendar,mftContacts,mftJournal,mftNotes,mftTasks,mftSpecial,mftMail,mftStuff};
mapi_TFolderType GetFolderType(mapi_TEntryid &eid, IMAPIFolder *f);
      

in my .cpp file of the class
mapi_TFolderType MapiClass::GetFolderType(mapi_TEntryid &eid, IMAPIFolder *f)

errors:

c:\temp\SynchroTest\MapiClass.cpp(478): error C2143: syntax error : missing ';' before 'MapiClass::GetFolderType'
c:\temp\SynchroTest\MapiClass.cpp(478): error C2501: 'mapi_TFolderType' : missing storage-class or type specifiers
c:\temp\SynchroTest\MapiClass.cpp(479): error C2556: 'int MapiClass::GetFolderType(mapi_TEntryid &,IMAPIFolder *)' : overloaded function differs only by return type from 'MapiClass::mapi_TFolderType MapiClass::GetFolderType(mapi_TEntryid &,IMAPIFolder *)'
c:\temp\SynchroTest\MapiClass.cpp(479): error C2371: 'MapiClass::GetFolderType' : redefinition; different basic types

I'm guessing its something simple that I just can't see.  
0
Comment
Question by:jjacksn
1 Comment
 
LVL 5

Accepted Solution

by:
mtmike earned 250 total points
ID: 9620971
In case the enum type is defined inside the class

class MapiClass {
public:
      enum mapi_TFolderType {
            mftInbox, mftOutbox
      };

      mapi_TFolderType MapiClass::GetFolderType();
};

then you have to specify its full type name when using it outside the class

MapiClass::mapi_TFolderType MapiClass::GetFolderType()
{
}
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

706 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

16 Experts available now in Live!

Get 1:1 Help Now