Solved

URGENT: Simple Header problem

Posted on 2003-10-25
1
236 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
[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 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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

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…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
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 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.

726 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