error in CleanupStack::PopAndDestroy()

Login to reply to this topic.
Thu, 2007-11-15 13:19
Joined: 2007-11-02
Forum posts: 37

Hi,
I get error in the following lines:===
RFile attachment;
TInt error=attachment.Open(CCoeEnv::Static()->FsSession(),AttachmentFile,EFileShareReadersOnly|EFileRead);
CleanupClosePushL(attachment);
CleanupStack::PopAndDestroy(attachment);//.......this line is marked as red->gives error

Errors:-----

1.'CleanupStack::PopAndDestroy()' (static)
2.'CleanupStack::PopAndDestroy(int, void *)' (static)
3.'CleanupStack::PopAndDestroy(int)' (static)
4.'CleanupStack::PopAndDestroy(void *)' (static)
5.function call '[CSmsOperations].PopAndDestroy({lval} RFile)' does not match

Where:--------

#define KDirPictures PathInfo::ImagesPath()
#define KPhoneRootPath PathInfo::PhoneMemoryRootPath()
_LIT (KFileName2,"Snapspy.jpg");

TFileName AttachmentFile(KDirPictures);
AttachmentFile.Append(KPhoneRootPath );
AttachmentFile.Append(KFileName);


Thu, 2007-11-15 13:25
Joined: 2003-12-05
Forum posts: 672
Re: error in CleanupStack::PopAndDestroy()

PopAndDestroy expects to have a pointer as a parameter. RFile object is not a pointer. Do PopAndDestroy(&attachment) instead.

Thu, 2007-11-15 13:51
Joined: 2007-11-02
Forum posts: 37
Re: error in CleanupStack::PopAndDestroy()

thanks it works

  • Login to reply to this topic.