SMTPConnection - weird error - VS 2005
-
Hello all, I am being driven crazy by the following stupid run-time error, and I would appreciate very much if someone could help me resolve it. Particulatly, I have the following code:
1: CMimeMessage msg;
2: msg.AddRecipient(_T("to@yahoo.com"));
3: msg.SetSender(_T("from@yahoo.com"));
4: msg.SetSubject(_T("Greetings"));First three lines of code work perfect. But when I try to execute the 4th one, I get a runtime error, and when I click to retry, I am redirected to following piece of code in file: atlspriv.h.
inline BOOL AtlMimeConvertStringW(
__in IMultiLanguage *pMultiLanguage,
__in UINT uiCodePage,
__in LPCWSTR wszIn,
__out_ecount_part_z(*pnLen, *pnLen) LPSTR *ppszOut,
__inout UINT *pnLen) throw()
{
ATLENSURE( pMultiLanguage != NULL ); // THIS ASSERTION IS THE ONE THAT FAILS !!!
ATLENSURE( wszIn != NULL );
...Has anybody any idea what can be wrong here ? The funny thing is that, all methods in previous code require same parameter, i.e. LPCTSTR, so why should one fail, when another doesnt ? I dont know, I am confused :( I would appreciate any hints, or whatever.. PS. I googled and found out that someone, fixed the problem by using ::CoInitialize(NULL) call, but I cant us it, as it is obsolete in VS2005. ( http://www.tech-archive.net/Archive/VC/microsoft.public.vc.atl/2007-02/msg00055.html )
-
Hello all, I am being driven crazy by the following stupid run-time error, and I would appreciate very much if someone could help me resolve it. Particulatly, I have the following code:
1: CMimeMessage msg;
2: msg.AddRecipient(_T("to@yahoo.com"));
3: msg.SetSender(_T("from@yahoo.com"));
4: msg.SetSubject(_T("Greetings"));First three lines of code work perfect. But when I try to execute the 4th one, I get a runtime error, and when I click to retry, I am redirected to following piece of code in file: atlspriv.h.
inline BOOL AtlMimeConvertStringW(
__in IMultiLanguage *pMultiLanguage,
__in UINT uiCodePage,
__in LPCWSTR wszIn,
__out_ecount_part_z(*pnLen, *pnLen) LPSTR *ppszOut,
__inout UINT *pnLen) throw()
{
ATLENSURE( pMultiLanguage != NULL ); // THIS ASSERTION IS THE ONE THAT FAILS !!!
ATLENSURE( wszIn != NULL );
...Has anybody any idea what can be wrong here ? The funny thing is that, all methods in previous code require same parameter, i.e. LPCTSTR, so why should one fail, when another doesnt ? I dont know, I am confused :( I would appreciate any hints, or whatever.. PS. I googled and found out that someone, fixed the problem by using ::CoInitialize(NULL) call, but I cant us it, as it is obsolete in VS2005. ( http://www.tech-archive.net/Archive/VC/microsoft.public.vc.atl/2007-02/msg00055.html )
stack overwrite? What happens in the debugger?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc -- PC Power delivered to your phone](http://www.soonr.com)
-
stack overwrite? What happens in the debugger?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc -- PC Power delivered to your phone](http://www.soonr.com)
ATLENSURE( pMultiLanguage != NULL ); // THIS ASSERTION IS THE ONE THAT FAILS !!!
-
ATLENSURE( pMultiLanguage != NULL ); // THIS ASSERTION IS THE ONE THAT FAILS !!!
well, that's why I said it might be someone overwriting the stack... What happens in the debugger?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc -- PC Power delivered to your phone](http://www.soonr.com)