Registry library - DeleteSubKey not working

Discussion in 'Questions (Windows Mobile)' started by zdenkot, Sep 22, 2008.

  1. zdenkot

    zdenkot Member Licensed User

    According to my tests there is problem in registry library because
    DeleteSubKey and DeleteSubKeyTree are doing nothing
    (no delete but no error posted )
    I received same result on my HTC Tytn II (WM5 - CF2) and
    HP iPAQ 614 (WM6 - CF2).

    Sub App_Start
    reg.New1
    reg.RootKey(reg.rtCurrentUser)
    ErrorLabel(errcreate)
    reg.CreateSubKey("Software","My Applicaton")
    Msgbox("The key was created.")
    ErrorLabel(errdelete)
    reg.DeleteSubKey("Software","My Applicaton")
    Msgbox("After DeleteSubKey")
    reg.DeleteSubKeyTree("Software","My Applicaton")
    Msgbox("After DeleteSubKeytree")
    ErrorLabel(errdeletenonexsist)
    reg.DeleteSubKey("Software","My xxx")
    Msgbox("E N D of test")
    Return
    errcreate:
    Msgbox("Created - err")
    Return
    errdelete:
    Msgbox("Delete - err")
    Return
    errdeletenonexsist:
    Msgbox("Delete - not exist")
    Return
    End Sub

    Please let me know if I am doing something wrong !
    I need a solution (workaround) for my ongoing project.

    :signOops:
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    I've checked your code and it works fine, Software / My Application is deleted.
    It is probably a security restriction on your devices (which may require a signed application to delete registry keys).
     
  3. zdenkot

    zdenkot Member Licensed User

    Erel

    It is strange that I can create subkeys without any problem but deleteing of that keys is not possible on my devices. Also I can create and delete subkeys and values using CeRegEditor. I am not familiar with ”signed application” e.g. how to make it.
    I am wondering is there any possibility to overcome this problem by using door library.
    In previous post I forgot to mention that I’m using B4PPC version 6.01.

    Regards
     
  4. seongjin

    seongjin Member Licensed User

    I'm using b4PPC 6.80 and have similar problem.

    A Key
    A Sub Key 1
    A Sub Key 2
    A Key Value 1
    A Key Value 2

    DeleteSubkeyTree ("", A Key) can delete A sub Key 1 and 2, but A Key Value 1 and 2 are not deleted.

    To make sure the deletion, I used it like below, but no luck as well.

    DeleteSubkeyTree ("", A Key)
    DeleteSubkey ("", A Key)

    Any checking and help please.
     
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