CMimeMessage error please help
-
Hi all, I have a project that uses unicode character set this snippet gives me an error:
CMimeMessage msg;
CoInitialize(0);
msg.SetSender(L"Administrator@redmap.com");
msg.SetSenderName(A2T("Redmap Networks"));
msg.AddRecipient(EmailAddress);
strValue = W2A(EmailAddress);char dom[100]="";
int a = GetDomain(strValue.c_str(), dom);
if (a == 0){
strValue = dom;
msg.SetSubject(A2T("Download Notification"));The bold part gives me errors and i found them here(atlmime.h):
inline BOOL SetSenderName(LPCTSTR szName, UINT uiCodePage = 0) throw()
{
if (szName == NULL)
return FALSE;CHeapPtr<char> szNamePtr; UINT nLen(0); BOOL bRet = **AtlMimeConvertString(m\_spMultiLanguage, uiCodePage, szName, &szNamePtr, &nLen);** if (bRet) {
It seems that m_spMultiLanguage must be initialized, how do I do that? I tried calling CoInitialize(0) before feeling up msg it wont work. Any advice? Thanks, Jayjay
-
Hi all, I have a project that uses unicode character set this snippet gives me an error:
CMimeMessage msg;
CoInitialize(0);
msg.SetSender(L"Administrator@redmap.com");
msg.SetSenderName(A2T("Redmap Networks"));
msg.AddRecipient(EmailAddress);
strValue = W2A(EmailAddress);char dom[100]="";
int a = GetDomain(strValue.c_str(), dom);
if (a == 0){
strValue = dom;
msg.SetSubject(A2T("Download Notification"));The bold part gives me errors and i found them here(atlmime.h):
inline BOOL SetSenderName(LPCTSTR szName, UINT uiCodePage = 0) throw()
{
if (szName == NULL)
return FALSE;CHeapPtr<char> szNamePtr; UINT nLen(0); BOOL bRet = **AtlMimeConvertString(m\_spMultiLanguage, uiCodePage, szName, &szNamePtr, &nLen);** if (bRet) {
It seems that m_spMultiLanguage must be initialized, how do I do that? I tried calling CoInitialize(0) before feeling up msg it wont work. Any advice? Thanks, Jayjay
What error did you get? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles] -
What error did you get? :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
[My articles]Its all ok now i just had to call coinitialize before creating an object.