Results 1 to 4 of 4

Thread: Vista: Drives me Nuts!

  1. #1

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Question Vista: Drives me Nuts!

    This is seriously doing my head in.

    Im running XP alongside VISTA on a Virtualization with MS Virtual PC to test the app.

    This is my code, very simple: Read Value Data from Registry. If the len >=1 or = vbNullstring then Skip

    If Len(RGGetKeyValue(theRootKey, regKey & QueryKeys(X), getValues(0))) >= 1 Then GoTo SkipThisOne
    If Not RGGetKeyValue(theRootKey, regKey & QueryKeys(X), getValues(0)) = vbNullstring Then GoTo SkipThisOne

    MsgBox Len(RGGetKeyValue(theRootKey, regKey & QueryKeys(X), getValues(0)))
    MsgBox RGGetKeyValue(theRootKey, regKey & QueryKeys(X), getValues(0))


    '''More code


    SkipThisOne:
    Now guess what the MsgBoxes return: 0 & vbNullstring, but yet again it doesnt go to the SkipThisOne label

    This works with XP.

    'The Exe also has a manifest inserted with Resource Hacker, to allow admin elevation etc...
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



  2. #2
    Hyperactive Member
    Join Date
    Oct 2007
    Location
    Indiana
    Posts
    295

    Re: Vista: Drives me Nuts!

    Hmmm, not sure. Vista is pretty picky about the registry.

    Have you thought about setting an intermediate value then evaluating that?

    Code:
    xLength = Len(RGGetKeyValue(theRootKey, regKey & QueryKeys(X), getValues(0)))
    If xLength >= 1 Then GoTo SkipThisOne
    and maybe this will work better....
    Code:
    If IsNull(RGGetKeyValue(theRootKey, regKey & QueryKeys(X), getValues(0)))  Then GoTo SkipThisOne
    or maybe try an intermediate value here also
    Code:
    If IsNull(RGGetKeyValue(theRootKey, regKey & QueryKeys(X), getValues(0)))  Then TempFlag = True else TempFlag = False
    
    If TempFlag then GoTo SkipThisOne

  3. #3
    Head Hunted anhn's Avatar
    Join Date
    Aug 2007
    Location
    Australia
    Posts
    3,669

    Re: Vista: Drives me Nuts!

    My suggestion:
    Code:
        Dim sValue As String
        '... ...
        sValue = "" & RGGetKeyValue(theRootKey, regKey & QueryKeys(X), getValues(0))
        If Len(sValue) Then GoTo SkipThisOne
        '... ...
    SkipThisOne:
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • If your question was answered please use Thread Tools to mark your thread [RESOLVED]
    • Don't forget to RATE helpful posts

    • Baby Steps a guided tour
    • IsDigits() and IsNumber() functions • Wichmann-Hill Random() function • >> and << functions for VB • CopyFileByChunk

  4. #4

    Thread Starter
    Frenzied Member some1uk03's Avatar
    Join Date
    Jun 2006
    Location
    London, UK
    Posts
    1,675

    Re: Vista: Drives me Nuts!

    Thanx guys but no, no, no... Its still there!!!

    Len = 0 but it still goes through when it shouldnt!!
    Last edited by some1uk03; Aug 21st, 2008 at 07:50 AM.
    _____________________________________________________________________

    ----If this post has helped you. Please take time to Rate it.
    ----If you've solved your problem, then please mark it as RESOLVED from Thread Tools.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width