OwnerInfo for Smartphone

Discussion in 'Questions (Windows Mobile)' started by kshetarpal, Nov 21, 2007.

  1. kshetarpal

    kshetarpal Member Licensed User

    I tried to used the Owner info file for smartphone and ran into problems. How does one add Objects since the Visual IDE does not allow it. I added the library but do not know how to add the object.

    The First line Reg.New1 can not be added. How does one do this?
    Thanks for your help.
    Amit

    The code is below:


    Sub App_Start
    Reg.New1 'Registry object is named 'reg'
    Main.Show
    End Sub


    Sub File_Click

    If CPPC = false Then Return 'this is not for the desktop

    Reg.RootKey(Reg.rtCurrentUser)
    buff() =Reg.GetValue("ControlPanel\Owner\","Owner")
    For i = 0 To ArrayLen(buff()) -1 Step 2
    If buff(i)=0 Then Exit 'Chr(0) separates the name from other owner entries
    m = m & Chr(buff(i))
    Next

    'Msgbox ("Owner name is "& m)
    End Sub
     
  2. specci48

    specci48 Well-Known Member Licensed User

    Tools > Add Object > Registry

    ... and type Reg into the prompted dialog window.


    specci48
     
  3. kshetarpal

    kshetarpal Member Licensed User

    Add Object grayed out

    For some reason the ADDObject under TOOLs is grayed out and nonfunctional. Why would that be?
     
  4. kshetarpal

    kshetarpal Member Licensed User

    Adding Object & other issues

    I found out that I have to add DLL file in both Device and desktop to add the object.
    After I compile the project and transfer it to the device, I get the following error:
    "Invalid CastException"
     
  5. Erel

    Erel Administrator Staff Member Licensed User

  6. kshetarpal

    kshetarpal Member Licensed User

    OwnerInfo on Smartphone error

    Thanks for the information, I eventually figured that out. Now back to the real question, Get Owner Info Working on Smartphone.
    I managed to compile the project and transfer it to the device, I get the following error:
    "Invalid CastException"
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    This key is not available on all devices.
    New devices store this information under: CurrentUser\ControlPanel\Owner\Name
    The format is different as well (simple string).
    Here is a very nice registry editor: http://www.phm.lu/Products/Smartphone/RegEdit/
     
  8. kshetarpal

    kshetarpal Member Licensed User

    Smartphone Owner Name

    I checked the registry value with the program you mentioned. And it is indeed "CurrentUser\Control Panel\Owner\Name". However with this change I get an error message:
    "An error occured on SubOwner_Click.
    Line Number 0.
    Error Description: An error occurred retrieving the registry key"
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    What code are you using to read the registry?
    Try this:
    Code:
    Reg.RootKey(Reg.rtCurrentUser)
    msgbox(Reg.GetValue("ControlPanel\Owner\","Name"))
     
  10. kshetarpal

    kshetarpal Member Licensed User

    Thank you very much. The code you suggest worked.
     
  11. tsdt

    tsdt Active Member Licensed User

    Hi Erel,

    You have posted a link to the nice regeditor application for this thread. I tried to access to it, but, seem like the link is no longer exist. I was wondering do you still happen to have the regeditor for the Win CE/Win Mobile?

    If not, do you know any nice powerful regeditor for me to navigate the registry in Win Mobile/ Win CE??

    Thanks.

    :sign0089:
     
  12. Erel

    Erel Administrator Staff Member Licensed User

Loading...