EDN Admin
Well-known member
<p style="line-height:normal; background:white <span style="font-size:7.0pt; font-family:"Verdana","sans-serif"; color:black We are facing a crash issue in our application. To debug the crash issue we have directly executed the application from code.
<p style="line-height:normal; background:white <span style="font-size:7.0pt; font-family:"Verdana","sans-serif"; color:black To trace the error we have removed the checked from " <span style="font-size:7.0pt; font-family:"Verdana","sans-serif"; color:black Enable
Just My Code <span style="font-size:7.0pt; font-family:"Verdana","sans-serif"; color:black " options in Debugging and we have checked the " <span style="font-size:7.0pt; font-family:"Verdana","sans-serif"; color:black Enabled
unmanaged code debugging <span style="font-size:7.0pt; font-family:"Verdana","sans-serif"; color:black " option in project properties Debug tab.
<p style="line-height:normal; background:white <span style="font-size:7.0pt; font-family:"Verdana","sans-serif"; color:black During execution it throws the error shown below:
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Windows has triggered a breakpoint in Opkey_CT.exe. <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black This may be due to a corruption of the heap, which indicates a bug in Opkey_CT.exe or any of the DLLs it has loaded. <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black This may also be due to the user pressing F12 while Opkey_CT.exe has focus. <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black The output window may have more diagnostic information. <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black The line of code at which this error is thrown is highlighted bold in the code given below:
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Try
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black If File.Exists(snap_path) Then
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Dim snapreader
As New IO.StreamReader(snap_path)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Dim src_snap As
String = snapreader.ReadToEnd()
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Dim arrsnap()
As String = Split(src_snap, ",")
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black If arrsnap.Length
> 1 Then
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
src_snap = arrsnap(1)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
arrsnap = Nothing
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black End If
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black snapreader.Close()
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black snapreader.Dispose()
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black snapreader = Nothing
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Dim imageBytes
As Byte() = Convert.FromBase64String(src_snap)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Dim ms As New
MemoryStream(imageBytes, 0, imageBytes.Length)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Convert byte[]
to Image
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black ms.Write(imageBytes,
0, imageBytes.Length)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Dim
imgsnap As Image = Image.FromStream(ms, True)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black imgsnap.Save(Images
+ "step_" + stepid.ToString + ".png")
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black ms.Close()
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black ms.Dispose()
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black ms = Nothing
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black imgsnap.Dispose()
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black imgsnap = Nothing
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black File.Delete(snap_path)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black End If
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Catch ex As Exception
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black WriteErrorLog("ConvertingSnapFromBase64()-->
" + ex.ToString)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black End Try
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black What does this error means? Is there any problem within the code?
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Also when we saw the output window it is throwing some exceptions like one is " <span style="font-size:8.0pt; font-family:Consolas; color:black A
first chance exception of type System.ArgumentOutOfRangeException occurred in mscorlib.dll" <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:8.0pt; font-family:"Times New Roman","serif"; color:black What does this exception means?
<p style="line-height:normal; background:white <span style="font-size:8.0pt; font-family:"Times New Roman","serif"; color:black We also have all output window messages if that is required please let us know.
<p style="line-height:normal; background:white
<p style="line-height:normal; background:white <span style="font-size:8.0pt; font-family:"Times New Roman","serif"; color:black Any help will be greatly appreaciated.
<p style="line-height:normal; background:white <span style="font-size:8.0pt; font-family:"Times New Roman","serif"; color:black <br/>
<hr class="sig Regards, Premjeet Singh
View the full article
<p style="line-height:normal; background:white <span style="font-size:7.0pt; font-family:"Verdana","sans-serif"; color:black To trace the error we have removed the checked from " <span style="font-size:7.0pt; font-family:"Verdana","sans-serif"; color:black Enable
Just My Code <span style="font-size:7.0pt; font-family:"Verdana","sans-serif"; color:black " options in Debugging and we have checked the " <span style="font-size:7.0pt; font-family:"Verdana","sans-serif"; color:black Enabled
unmanaged code debugging <span style="font-size:7.0pt; font-family:"Verdana","sans-serif"; color:black " option in project properties Debug tab.
<p style="line-height:normal; background:white <span style="font-size:7.0pt; font-family:"Verdana","sans-serif"; color:black During execution it throws the error shown below:
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Windows has triggered a breakpoint in Opkey_CT.exe. <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black This may be due to a corruption of the heap, which indicates a bug in Opkey_CT.exe or any of the DLLs it has loaded. <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black This may also be due to the user pressing F12 while Opkey_CT.exe has focus. <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black The output window may have more diagnostic information. <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black The line of code at which this error is thrown is highlighted bold in the code given below:
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Try
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black If File.Exists(snap_path) Then
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Dim snapreader
As New IO.StreamReader(snap_path)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Dim src_snap As
String = snapreader.ReadToEnd()
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Dim arrsnap()
As String = Split(src_snap, ",")
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black If arrsnap.Length
> 1 Then
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
src_snap = arrsnap(1)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
arrsnap = Nothing
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black End If
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black snapreader.Close()
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black snapreader.Dispose()
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black snapreader = Nothing
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Dim imageBytes
As Byte() = Convert.FromBase64String(src_snap)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Dim ms As New
MemoryStream(imageBytes, 0, imageBytes.Length)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Convert byte[]
to Image
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black ms.Write(imageBytes,
0, imageBytes.Length)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Dim
imgsnap As Image = Image.FromStream(ms, True)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black imgsnap.Save(Images
+ "step_" + stepid.ToString + ".png")
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black ms.Close()
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black ms.Dispose()
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black ms = Nothing
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black imgsnap.Dispose()
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black imgsnap = Nothing
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black File.Delete(snap_path)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black End If
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Catch ex As Exception
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black WriteErrorLog("ConvertingSnapFromBase64()-->
" + ex.ToString)
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black End Try
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black What does this error means? Is there any problem within the code?
<p style="line-height:normal; background:white <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black Also when we saw the output window it is throwing some exceptions like one is " <span style="font-size:8.0pt; font-family:Consolas; color:black A
first chance exception of type System.ArgumentOutOfRangeException occurred in mscorlib.dll" <span style="font-size:12.0pt; font-family:"Times New Roman","serif"; color:black
<p style="line-height:normal; background:white <span style="font-size:8.0pt; font-family:"Times New Roman","serif"; color:black What does this exception means?
<p style="line-height:normal; background:white <span style="font-size:8.0pt; font-family:"Times New Roman","serif"; color:black We also have all output window messages if that is required please let us know.
<p style="line-height:normal; background:white
<p style="line-height:normal; background:white <span style="font-size:8.0pt; font-family:"Times New Roman","serif"; color:black Any help will be greatly appreaciated.
<p style="line-height:normal; background:white <span style="font-size:8.0pt; font-family:"Times New Roman","serif"; color:black <br/>
<hr class="sig Regards, Premjeet Singh
View the full article