PDA

View Full Version : MSG to EML with Qt .....



AcerExtensa
16th June 2008, 09:11
Hi Everybody!,
Do somebody know any opensource Library or specs for Outlook e-mail (*.MSG) format?
I need to convert mails from msg to eml format....

Thanks for any help!!!

marcel
16th June 2008, 18:45
http://sourceforge.net/projects/mailboxsdkviewe/

AcerExtensa
17th June 2008, 08:18
Thank you!

AcerExtensa
17th June 2008, 08:40
It's not opensource and MSG converting feature is only in registered version :(


1- The Software is initially provided to you for evaluation purposes. It may be used free of charge on an unlimited number of machines for an unlimited amount of time.

2- Advanced features of the unregistered Software have been disabled and will only become enabled after registration of the Software has occurred.

Is where no opensource API for MSG? I can't find any.... :(

marcel
17th June 2008, 09:08
Try searching sourceforge. There are other libraries as well... that was just an example

AcerExtensa
17th June 2008, 11:07
That looks like what i need:
http://sourceforge.net/projects/ssfiledll/

get small problem. Need to convert BSTR string into char * or in unsigned short*.
Do somebody know how to do that?

marcel
17th June 2008, 11:11
http://www.codeproject.com/KB/string/bstrsproject1.aspx

AcerExtensa
17th June 2008, 11:18
I get it allready :) have found my old one function:



static inline char * BSTRToString(BSTR pSrc)
{
if(!pSrc) return "";

DWORD cb,cwch = ::SysStringLen(pSrc);

char *szOut = NULL;

if(cb = ::WideCharToMultiByte(CP_ACP, 0,
pSrc, cwch + 1, NULL, 0, 0, 0))
{
szOut = new char[cb];
if(szOut)
{
szOut[cb - 1] = '\0';

if(!::WideCharToMultiByte(CP_ACP, 0,
pSrc, cwch + 1, szOut, cb, 0, 0))
{
delete []szOut;
szOut = NULL;
}
}
}
::SysFreeString(pSrc);
return szOut;
}


it works for Qt too:


static inline QString BSTRToString(BSTR pSrc)
{
if(!pSrc) return "";

DWORD cb,cwch = ::SysStringLen(pSrc);

char *szOut = NULL;

if(cb = ::WideCharToMultiByte(CP_ACP, 0,
pSrc, cwch + 1, NULL, 0, 0, 0))
{
szOut = new char[cb];
if(szOut)
{
szOut[cb - 1] = '\0';

if(!::WideCharToMultiByte(CP_ACP, 0,
pSrc, cwch + 1, szOut, cb, 0, 0))
{
delete []szOut;
szOut = NULL;
}
}
}
::SysFreeString(pSrc);
return QString::fromAscii(szOut);
}


ssfiledll is nice simple msg parser.

Thanks marcel for helping me :)