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. Access violation writing location 0x00000000

Access violation writing location 0x00000000

Scheduled Pinned Locked Moved C#
csharphelp
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.
  • F Offline
    F Offline
    Farhan Ali
    wrote on last edited by
    #1

    Asalam o Alaikum: I have made a desktop application in c# which gets text from the controls like textboxes.on some forms it works fine but sometime gives this error Access violation writing location 0x00000000 how this error can be removed. Thanx

    R 1 Reply Last reply
    0
    • F Farhan Ali

      Asalam o Alaikum: I have made a desktop application in c# which gets text from the controls like textboxes.on some forms it works fine but sometime gives this error Access violation writing location 0x00000000 how this error can be removed. Thanx

      R Offline
      R Offline
      rp_suman
      wrote on last edited by
      #2

      This will happen when you assign something to a NULL pointer. Put a break point and debug step by step. See the variable at the left of error happening line. Best Regards, Suman

      F 1 Reply Last reply
      0
      • R rp_suman

        This will happen when you assign something to a NULL pointer. Put a break point and debug step by step. See the variable at the left of error happening line. Best Regards, Suman

        F Offline
        F Offline
        Farhan Ali
        wrote on last edited by
        #3

        It happens when this line executes SendMessage(lvwHwnd, LVM_GETITEMTEXT, selectedrow, _lvi); _lvi is the pointer which is not null it has some address. hopefully this info will help u to answer Thanx

        CPalliniC L 2 Replies Last reply
        0
        • F Farhan Ali

          It happens when this line executes SendMessage(lvwHwnd, LVM_GETITEMTEXT, selectedrow, _lvi); _lvi is the pointer which is not null it has some address. hopefully this info will help u to answer Thanx

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          Seems the wrong forum (C++ one is more appropriate), anyway... you have to pass valid pointer to a valid LVITEM struct, i.e. a properly initialised struct (you have to take special care with pszText and cchTextMax members, the former must point to an allocated buffer, the latter must contain the size of the buffer itself, see MSDN [^]). Hope that helps. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.

          In testa che avete, signor di Ceprano?

          1 Reply Last reply
          0
          • F Farhan Ali

            It happens when this line executes SendMessage(lvwHwnd, LVM_GETITEMTEXT, selectedrow, _lvi); _lvi is the pointer which is not null it has some address. hopefully this info will help u to answer Thanx

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

            Hi, if you happen to send a message to another process, and that message needs an address, then that address must be valid in that process, not in the local process. whatever, publishing the entire method (and relevant data members) may allow us to comment. :)

            Luc Pattyn [My Articles]

            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