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