Trouble in Using MapitoMimestm help urgent

I have encountered Access violation reading location with this code:

IConverterSession* sample; sample = NULL; IStream *istream; istream = 0; sample->SetEncoding(IET_QP); sample->SetSaveFormat(SAVE_RFC822); hResult = sample->MAPIToMIMEStm(LPMESSAGE(msgName.c_str()), istream, CCSF_SMTP); if (hResult !=S_OK){ throw(HResultException("MAPIToMIMEStm ResolveMsg",0)); }

I am really new to this can anyone guide me in making this work?

Thanks a lot,
Jj
[496 byte] By [monsieur_jj] at [2007-11-20 10:39:40]