Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. SMTPConnection - weird error - VS 2005

SMTPConnection - weird error - VS 2005

Scheduled Pinned Locked Moved C / C++ / MFC
helpcsharpc++htmlvisual-studio
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bigdenny200
    wrote on last edited by
    #1

    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 )

    P 1 Reply Last reply
    0
    • B bigdenny200

      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 )

      P Offline
      P Offline
      Peter Weyzen
      wrote on last edited by
      #2

      stack overwrite? What happens in the debugger?

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc -- PC Power delivered to your phone](http://www.soonr.com)

      B 1 Reply Last reply
      0
      • P Peter Weyzen

        stack overwrite? What happens in the debugger?

        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc -- PC Power delivered to your phone](http://www.soonr.com)

        B Offline
        B Offline
        bigdenny200
        wrote on last edited by
        #3

        ATLENSURE( pMultiLanguage != NULL ); // THIS ASSERTION IS THE ONE THAT FAILS !!!

        P 1 Reply Last reply
        0
        • B bigdenny200

          ATLENSURE( pMultiLanguage != NULL ); // THIS ASSERTION IS THE ONE THAT FAILS !!!

          P Offline
          P Offline
          Peter Weyzen
          wrote on last edited by
          #4

          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)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups