Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6770781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:21:13+00:00 2026-05-26T15:21:13+00:00

I’ve got a timer which ticks every half a second. It calls a background

  • 0

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.

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) < 25 Then
                        FontColor = Settings1.Default.CriticalColor
                    ElseIf Math.Round((this / that) * 100, decimals:=0) >= 25 And Math.Round((actualsize / ofsize) * 100, decimals:=0) < 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 & vbCrLf & "Free space:" & vbCrLf & actualsize & stringvalue1 & " of " & ofsize & stringvalue2 & " (" & (Math.Round((this / that), decimals:=2) * 100) & "%)"
                    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 & "\DT crash log.txt", "Log: " & My.Computer.Clock.LocalTime.Date.ToString & vbCrLf & o.ToString & vbCrLf & vbCrLf, True)
            End Try
        End Sub

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.

Can anyone give me any pointers?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:21:14+00:00Added an answer on May 26, 2026 at 3:21 pm

    I can’t tell with certainty from your code snippet, but I suspect the issue is that you are attempting to update something on the user interface thread from the background thread. This will invariably lead to crashes like you are experiencing.

    If you update the user interface, you must use Invoke on an object that is running on the UI thread. Here are a couple of links that may get you started on this:

    How can I update my user interface from a thread that did not create it?

    Updating the UI from a thread – The simplest way

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text area in my form which accepts all possible characters from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
I have a bunch of posts stored in text files formatted in yaml/textile (from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
i got an object with contents of html markup in it, for example: string
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.