Solved

URGENT: Simple Header problem

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Prototype for MessageDlg in Embacadero XE 2 2 35
Fast, free, private online code repository / editor 7 90
FMX enumerated colours 2 84
What is sub-make ? 2 40
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

867 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

23 Experts available now in Live!

Get 1:1 Help Now