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
  1. Home
  2. General Programming
  3. C#
  4. Control.BeginInvoke()

Control.BeginInvoke()

Scheduled Pinned Locked Moved C#
3 Posts 3 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.
  • K Offline
    K Offline
    kmb89
    wrote on last edited by
    #1

    I use the following code to operate my treeview asynchronously. IAsyncResult result = sourceTree.BeginInvoke(l_CreateTreeNodes, new object[] { sourcenode.Nodes[stables],destinationnode.Nodes[dtables],mSourceInfo.TableNames,mDestinationInfo.TableNames}); While(!result.IsCompleted){} But asynchronous operation is not completed and 'result.IsCompleted" property is always 'false'. So, the operation isn't existed from while loop. I don't know why 'IsCompleted' property is always false. :confused:

    N P 2 Replies Last reply
    0
    • K kmb89

      I use the following code to operate my treeview asynchronously. IAsyncResult result = sourceTree.BeginInvoke(l_CreateTreeNodes, new object[] { sourcenode.Nodes[stables],destinationnode.Nodes[dtables],mSourceInfo.TableNames,mDestinationInfo.TableNames}); While(!result.IsCompleted){} But asynchronous operation is not completed and 'result.IsCompleted" property is always 'false'. So, the operation isn't existed from while loop. I don't know why 'IsCompleted' property is always false. :confused:

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

      If you need blocking calls, why to use BeginInvoke? Use Invoke instead. It is synchronous and waits until the message is processed.

      Navaneeth How to use google | Ask smart questions

      1 Reply Last reply
      0
      • K kmb89

        I use the following code to operate my treeview asynchronously. IAsyncResult result = sourceTree.BeginInvoke(l_CreateTreeNodes, new object[] { sourcenode.Nodes[stables],destinationnode.Nodes[dtables],mSourceInfo.TableNames,mDestinationInfo.TableNames}); While(!result.IsCompleted){} But asynchronous operation is not completed and 'result.IsCompleted" property is always 'false'. So, the operation isn't existed from while loop. I don't know why 'IsCompleted' property is always false. :confused:

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #3

        Not that it matters, but why {} rather than ; ?

        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