I'm trying to find Link example for connecting either to (pop3 or Imap) email server protocol , I find good example on the following link:
http://www3.symbian.com/CPPSupp.nsf/0/1ede86ffe0cf5dc8802569df003cdfb9?OpenDocument&Click=
when I tried to compile it gives the following compilation error:
error C2259:'TObserver' : cannot instantiate abstract class ,I'll be appreciated if any body find out how to resolve this compile error.
Many Thanks
Here Is the classes declarations and the error details:
InternetEmailApp.cpp
EMailCon.cpp
src\EMailCon.cpp(69) : error C2259: 'TObserver' : cannot instantiate abstract class
due to following members:
'void MMsvSessionObserver::HandleSessionEventL(MMsvSessionObserver::TMsvSessionEvent,TAny *,TAny *,TAny *)' : pure virtual function was not defined
C:\Symbian\7.0s\Series60_v20\\Epoc32\include\msvapi.h(370) : see declaration of 'MMsvSessionObserver::HandleSessionEventL'
Generating Code...
void CEMailSettings::ConstructL()
{
iObserver=new(ELeave) TObserver;
//TObserver* iObserver=new(ELeave) TObserver();
iObserver->iOwner=this;
iMsvSession = CMsvSession::OpenSyncL(*iObserver);
TMsvSelectionOrdering ordering;
iMsvEntry = CMsvEntry::NewL(*iMsvSession, KMsvRootIndexEntryId, ordering);
}
class CEMailSettings;
class TObserver : public MMsvSessionObserver
{
public:
/*~TObserver*/ ();
virtual void HandleSessionEvent(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
private:
CEMailSettings* iOwner;
friend class CEMailSettings;
};
class CEMailSettings : public CBase
{
public:
enum TAccountPairType {ESmtpAndPop3,ESmtpAndImap4};
public:
static CEMailSettings* NewL();
void ConstructL();
~CEMailSettings();
public:
void CreateNewAccount(TAccountPairType aAccountPairType=ESmtpAndPop3);
private:
TMsvId CreateServiceL(const TUid aMtm, TBool aReadOnly, TBool aVisible, const TDesC& aName);
protected:
CEMailSettings();
private:
CMsvEntry* iMsvEntry;
CMsvSession* iMsvSession;
TObserver* iObserver;
friend class TObserver;
};