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. Visual Basic
  4. DoEvents

DoEvents

Scheduled Pinned Locked Moved Visual Basic
csharpcomdebugginghelp
2 Posts 2 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.
  • M Offline
    M Offline
    Mike Mestemaker
    wrote on last edited by
    #1

    Has anyone else had problems with the Application.DoEvents statement? I have a VB.net written DLL that throws the ubiquitous "Object reference not set..." error on a couple of machines. I can't duplicate the error on my desk or on other machines. When I put code in to trace down exactly which statement it's on when the error hits, it's a DoEvents statement. I mostly put those in to give the calling apps time to process other events, so they aren't all critical. So, in an attempt to narrow it down, I removed the offending statement. The error hit again but this time on the next DoEvents statement it found in the code. This has got me completely puzzled. Normally, when something happens on one machine and not one all, I check to make sure any referenced DLL's are the same. They are. This DLL calls 2 COM objects and 1 .NET DLL and all of those references are identical in version. I know the error normally means that someone forgot a "NEW" statement or an object was inadvertantly set to Nothing, but I can't find any object where that would make sense. If that was the case, the DLL wouldn't run cleanly anywhere, but it does run OK on some machines, including in the development environment. Any ideas would be greatly appreciated.

    L 1 Reply Last reply
    0
    • M Mike Mestemaker

      Has anyone else had problems with the Application.DoEvents statement? I have a VB.net written DLL that throws the ubiquitous "Object reference not set..." error on a couple of machines. I can't duplicate the error on my desk or on other machines. When I put code in to trace down exactly which statement it's on when the error hits, it's a DoEvents statement. I mostly put those in to give the calling apps time to process other events, so they aren't all critical. So, in an attempt to narrow it down, I removed the offending statement. The error hit again but this time on the next DoEvents statement it found in the code. This has got me completely puzzled. Normally, when something happens on one machine and not one all, I check to make sure any referenced DLL's are the same. They are. This DLL calls 2 COM objects and 1 .NET DLL and all of those references are identical in version. I know the error normally means that someone forgot a "NEW" statement or an object was inadvertantly set to Nothing, but I can't find any object where that would make sense. If that was the case, the DLL wouldn't run cleanly anywhere, but it does run OK on some machines, including in the development environment. Any ideas would be greatly appreciated.

      L Offline
      L Offline
      Lewis Moten
      wrote on last edited by
      #2

      Not sure why your application object isn't instantiated, but you could also try the tell the thread to whait a brief moment. System.Threading.Thread.CurrentThread.Sleep(500)

      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