newbee Registry question

Discussion in 'Questions (Windows Mobile)' started by sosimple, Feb 7, 2009.

  1. sosimple

    sosimple Member

    Hi. I dont know many things and i try only to read a value in registy.
    The value i try to read is here
    HKEY_CURRENT_USER\System\State\Phone\"Missed Call Count"
    NAME =Missed Call Count
    TYPE=DWORD
    VALUE=0

    I try this

    Code:
    Sub Globals
    number = 
    0
    End Sub

    Sub App_Start
          form1.Show
          reg.New1
          reg.RootKey(reg.rtCurrentUser)
          number=reg.GetValue(
    "System\State\Phone""Missed Call Count"
         TextBox1.text = number
         
            
    Msgbox("The value is: " &  number)
    End Sub
    And i get a error message for line number=reg.GetValue("System\State\Phone", "Missed Call Count")
    "object reference not set to an instance of an object"
    I have create an object reg:Registry
    Can anyone help? Thanks alot..

    *** edit I put it in the phone and it worked so forget the above!!
     
    Last edited: Feb 7, 2009
  2. agraham

    agraham Expert Licensed User

    I've cut and pasted your code and it works fine on my HTC Diamond. The normal cause for that error is that the Registry entry is not present. You are trying it on a device that actually has a phone aren't you? It is not present, for example, on my iPAQ 214 as that is not a phone.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice