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. Mobile Development
  3. Mobile
  4. NullReferenceException

NullReferenceException

Scheduled Pinned Locked Moved Mobile
help
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.
  • S Offline
    S Offline
    sandesh khare
    wrote on last edited by
    #1

    Hi all, I am working in a mobile device application. Things are going well.. but suddenly a NullReferenceException is occurring at various event handlers.. Is there any body who can solve the problem... sandesh khare.. :((

    sandesh

    M A 2 Replies Last reply
    0
    • S sandesh khare

      Hi all, I am working in a mobile device application. Things are going well.. but suddenly a NullReferenceException is occurring at various event handlers.. Is there any body who can solve the problem... sandesh khare.. :((

      sandesh

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      A NullReferenceException always occurs because you've tried to dereference a null reference. For example, if you try to manipulate a null string. The debugger will show you where the problem occurred. Then check all the variables used by that line of code. When you find the one that's null, that's where your problem is.

      DoEvents: Generating unexpected recursion since 1991

      S 1 Reply Last reply
      0
      • S sandesh khare

        Hi all, I am working in a mobile device application. Things are going well.. but suddenly a NullReferenceException is occurring at various event handlers.. Is there any body who can solve the problem... sandesh khare.. :((

        sandesh

        A Offline
        A Offline
        Abhi suryawanshi
        wrote on last edited by
        #3

        Check all objects that your passing to the event, where you got the NullReferenceException . :)

        Windows mobile development, pocket pc development , C#.net compact framework, Desktop application , web service

        1 Reply Last reply
        0
        • M Mike Dimmick

          A NullReferenceException always occurs because you've tried to dereference a null reference. For example, if you try to manipulate a null string. The debugger will show you where the problem occurred. Then check all the variables used by that line of code. When you find the one that's null, that's where your problem is.

          DoEvents: Generating unexpected recursion since 1991

          S Offline
          S Offline
          sandesh khare
          wrote on last edited by
          #4

          hi Mike.. I don't think that is the problem.. When I am in debug mode no problem occurs...when i am running with F5 then a message box appears with 'NullReferenceException'...So I am unable to get the exact line number of problem. sandesh khare :((

          sandesh

          A 1 Reply Last reply
          0
          • S sandesh khare

            hi Mike.. I don't think that is the problem.. When I am in debug mode no problem occurs...when i am running with F5 then a message box appears with 'NullReferenceException'...So I am unable to get the exact line number of problem. sandesh khare :((

            sandesh

            A Offline
            A Offline
            Arjun Marwaha
            wrote on last edited by
            #5

            Seems like one of the variables being used in the event handler does not have any value assigned to it. The reason it's not occurring in debug mode is that it gets the required time to get the value and therefore no exception is thrown. You can also check for the variables and their values at the time when the exception occurs which can give you a hint for the cause of the exception. ~Dave

            Dave Traister Software Engineer ComponentOne LLC www.ComponentOne.com

            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