Solved

URGENT: Simple Header problem

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 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.

691 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