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#
  4. Cannot evaluate expression because a native frame is on top of the call stack [modified]

Cannot evaluate expression because a native frame is on top of the call stack [modified]

Scheduled Pinned Locked Moved C#
helpc++data-structuresquestion
3 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.
  • E Offline
    E Offline
    enginco
    wrote on last edited by
    #1

    hi, I used below code for get mht file from given URL. But sometimes it dosn't work and wait.

            CDO.Message msg = new CDO.MessageClass();
            ADODB.Stream stm = null;
            byte\[\] data;
    
            msg.MimeFormatted = true;
            msg.CreateMHTMLBody(givenUrl, CDO.CdoMHTMLFlags.cdoSuppressAll, "", "");
            string path = destinationPath + "\\\\" + fileName;
            stm = msg.GetStream();
    
            stm.SaveToFile(path, ADODB.SaveOptionsEnum.adSaveCreateOverWrite);
            msg = null;
            stm.Close();
    

    when I debugged the code I saw this error in: msg --[CDO.MessageClass] ---- all items has error "Cannot evaluate expression because a native frame is on top of the call stack" it was stuck at this line : msg.CreateMHTMLBody(givenUrl, CDO.CdoMHTMLFlags.cdoSuppressAll, "", ""); are there any way to get if isTimeout or not? thanx...

    I want to fly but I don't have wings

    modified on Saturday, July 26, 2008 11:18 AM

    G 1 Reply Last reply
    0
    • E enginco

      hi, I used below code for get mht file from given URL. But sometimes it dosn't work and wait.

              CDO.Message msg = new CDO.MessageClass();
              ADODB.Stream stm = null;
              byte\[\] data;
      
              msg.MimeFormatted = true;
              msg.CreateMHTMLBody(givenUrl, CDO.CdoMHTMLFlags.cdoSuppressAll, "", "");
              string path = destinationPath + "\\\\" + fileName;
              stm = msg.GetStream();
      
              stm.SaveToFile(path, ADODB.SaveOptionsEnum.adSaveCreateOverWrite);
              msg = null;
              stm.Close();
      

      when I debugged the code I saw this error in: msg --[CDO.MessageClass] ---- all items has error "Cannot evaluate expression because a native frame is on top of the call stack" it was stuck at this line : msg.CreateMHTMLBody(givenUrl, CDO.CdoMHTMLFlags.cdoSuppressAll, "", ""); are there any way to get if isTimeout or not? thanx...

      I want to fly but I don't have wings

      modified on Saturday, July 26, 2008 11:18 AM

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      If you stop the code in the middle of unmanaged code, the debugger can't reach the items on the stack that is created by the managed objects because it doesn't know the size of the unmanaged stack frame. You have to step through the unmanaged code back into the managed code before the debugger can show you the contents of the stack.

      Despite everything, the person most likely to be fooling you next is yourself.

      E 1 Reply Last reply
      0
      • G Guffa

        If you stop the code in the middle of unmanaged code, the debugger can't reach the items on the stack that is created by the managed objects because it doesn't know the size of the unmanaged stack frame. You have to step through the unmanaged code back into the managed code before the debugger can show you the contents of the stack.

        Despite everything, the person most likely to be fooling you next is yourself.

        E Offline
        E Offline
        enginco
        wrote on last edited by
        #3

        Yes, you are right. I got it. I need timeout option, but there is no timeout property or parameter etc... I tested again the code if it will stuck or won't. It is still same but after 4-5 minutes it was aborted and it worked. 4-5 minutes is too long for me. I will work with thousands url, I can't wait 5 minutes for each url. How can it continue after 15 seconds? Is it possible?

        I want to fly but I don't have wings

        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