Note that there are some explanatory texts on larger screens.

plurals
  1. POCLR20R3 Error - Text to Image to Icon rendering issue (threading included) - VB.net
    primarykey
    data
    text
    <p>I've got a timer which ticks every half a second. It calls a background process which renders text as icons and uses them for notification icons.</p> <pre><code>Public Shared DISCUS(9) As NotifyIcon Private Sub BackgroundProcess2_DoWork() Handles BackgroundProcess2.DoWork Try For counter As Integer = 0 To My.Computer.FileSystem.Drives.Count - 1 Dim FontColor As Color If Math.Round((this / that) * 100, decimals:=0) &lt; 25 Then FontColor = Settings1.Default.CriticalColor ElseIf Math.Round((this / that) * 100, decimals:=0) &gt;= 25 And Math.Round((actualsize / ofsize) * 100, decimals:=0) &lt; 50 Then FontColor = Settings1.Default.WarningColor Else FontColor = Settings1.Default.NominalColor End If Dim BackColor As Color = Color.Transparent Dim FontName As String = Settings1.Default.InterfaceFont.Name Dim FontSize As Integer = 9 Dim iHeight As Integer = 16 Dim iWidth As Integer = 16 Dim objBitmap As New Bitmap(iWidth, iHeight) Dim objGraphics As Graphics = Graphics.FromImage(objBitmap) Dim objFont As New Font(FontName, FontSize) Dim objPoint As New PointF(1, 0) Dim objBrushForeColor As New SolidBrush(FontColor) Dim objBrushBackColor As New SolidBrush(BackColor) objGraphics.FillRectangle(objBrushBackColor, 0, 0, Width, Height) objGraphics.DrawString(Text, objFont, objBrushForeColor, objPoint) Dim img As Bitmap = objBitmap Dim hIcon As IntPtr = img.GetHicon() Dim icn As Icon = Icon.FromHandle(hIcon) DISCUS(counter).Text = My.Computer.FileSystem.GetDriveInfo(My.Computer.FileSystem.Drives.Item(counter).ToString).VolumeLabel &amp; vbCrLf &amp; "Free space:" &amp; vbCrLf &amp; actualsize &amp; stringvalue1 &amp; " of " &amp; ofsize &amp; stringvalue2 &amp; " (" &amp; (Math.Round((this / that), decimals:=2) * 100) &amp; "%)" DISCUS(counter).BalloonTipText = Text DISCUS(counter).Icon = icn icn.Dispose() DISCUS(counter).ContextMenuStrip = ContextMenuStrip1 Next Catch ex as exception My.Computer.FileSystem.WriteAllText(My.Computer.FileSystem.SpecialDirectories.Desktop &amp; "\DT crash log.txt", "Log: " &amp; My.Computer.Clock.LocalTime.Date.ToString &amp; vbCrLf &amp; o.ToString &amp; vbCrLf &amp; vbCrLf, True) End Try End Sub </code></pre> <p>Now for some reason, after a few minutes of the application being active, I get a JIT pop-up that doesn't render any text or buttons. Clicking on it causes the JIT debugger to crash, and I get the Windows "{App} has stopped responding." with error code CLR20R3. I'm not sure what this is all about, but I can provide any other details if needed. I've got everything nested in Try/Catch statements, all with code to write to a crash log but nothing gets written and I still get that error message.</p> <p>Can anyone give me any pointers?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload