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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. CheckForIllegalCrossThreadCalls = false for cross-thread control update

CheckForIllegalCrossThreadCalls = false for cross-thread control update

Scheduled Pinned Locked Moved C#
questionannouncement
5 Posts 4 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.
  • 1 Offline
    1 Offline
    12Code
    wrote on last edited by
    #1

    My app make cross-thread calls to many main form controls. I have disable CheckForIllegalCrossThreadCalls by set it to false, without using any Invoke method for the cross-thread control update. And the app is running fine so far. My question is: Is it okay to turn off CheckForIllegalCrossThreadCalls, for this cross-thread control update? What are the negative effects? Thanks.

    Kelvin

    N N L 3 Replies Last reply
    0
    • 1 12Code

      My app make cross-thread calls to many main form controls. I have disable CheckForIllegalCrossThreadCalls by set it to false, without using any Invoke method for the cross-thread control update. And the app is running fine so far. My question is: Is it okay to turn off CheckForIllegalCrossThreadCalls, for this cross-thread control update? What are the negative effects? Thanks.

      Kelvin

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      8kelvin wrote:

      What are the negative effects?

      It is only for debugging and will only work when the debugger is attached. Here is what MSDN says, Note that illegal cross-thread calls will always raise an exception when an application is started outside the debugger. :)

      Navaneeth How to use google | Ask smart questions

      1 1 Reply Last reply
      0
      • 1 12Code

        My app make cross-thread calls to many main form controls. I have disable CheckForIllegalCrossThreadCalls by set it to false, without using any Invoke method for the cross-thread control update. And the app is running fine so far. My question is: Is it okay to turn off CheckForIllegalCrossThreadCalls, for this cross-thread control update? What are the negative effects? Thanks.

        Kelvin

        N Offline
        N Offline
        Nagy Vilmos
        wrote on last edited by
        #3

        8kelvin wrote:

        What are the negative effects?

        :~ If you've seen Ghostbusters, I'm sure your aware what happens when you cross the threads. It is bad and kittens maybe hurt. You don't hate kittens do you? :-D


        Panic, Chaos, Destruction. My work here is done.

        1 Reply Last reply
        0
        • N N a v a n e e t h

          8kelvin wrote:

          What are the negative effects?

          It is only for debugging and will only work when the debugger is attached. Here is what MSDN says, Note that illegal cross-thread calls will always raise an exception when an application is started outside the debugger. :)

          Navaneeth How to use google | Ask smart questions

          1 Offline
          1 Offline
          12Code
          wrote on last edited by
          #4

          Hi Navaneeth, thank for the prompt reply. But the app that i mentioned already installed in other pc, and it run without any problem too.

          Kelvin

          1 Reply Last reply
          0
          • 1 12Code

            My app make cross-thread calls to many main form controls. I have disable CheckForIllegalCrossThreadCalls by set it to false, without using any Invoke method for the cross-thread control update. And the app is running fine so far. My question is: Is it okay to turn off CheckForIllegalCrossThreadCalls, for this cross-thread control update? What are the negative effects? Thanks.

            Kelvin

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            8kelvin wrote:

            Is it okay to turn off CheckForIllegalCrossThreadCalls

            Not at all. Your app will not work reliably if you do. That property should never have been introduced, they created it when .NET (evolving from 1.1 to 2.0) got strict on cross-thread checking, so they thought it was wise to provide a way to continue doing things the wrong way. :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            - before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


            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