Results 1 to 2 of 2

Thread: Registry

  1. #1

    Thread Starter
    Member
    Join Date
    May 2002
    Location
    USA
    Posts
    33

    Registry

    I am trying to get to this location in registry and my code is just not getting me there, here's my code? any help would be appricated?

    Here is where I am trying to get to:

    HKEY_LOCAL_MACHINE\SOFTWARE\Novell\Location Profiles\Services\{1E6CEEA1-FB73-11CF-BD76-00001B27DA23}\Default\Tab1

    Here is my code:

    Public Function fGetstring1(HKey As Long, strPath As String, strValue As String)
    Dim keyhand As Long
    Dim datatype As Long
    Dim lResult As Long
    Dim strBuf As String
    Dim lDataBufSize As Long
    Dim intZeroPos As Integer
    'Open it
    r = RegOpenKey(HKey, strPath, keyhand)
    'Query the registry
    lResult = RegQueryValueEx(keyhand, strValue, 0&, lValueType, ByVal 0&, lDataBufSize)
    If lValueType = REG_SZ Then
    strBuf = String(lDataBufSize, " ")
    lResult = RegQueryValueEx(keyhand, strValue, 0&, 0&, ByVal strBuf, lDataBufSize)
    If lResult = ERROR_SUCCESS Then
    intZeroPos = InStr(strBuf, Chr$(0))
    If intZeroPos > 0 Then
    fGetstring = Left$(strBuf, intZeroPos - 1)
    Else
    fGetstring = strBuf
    End If
    End If
    End If
    End Function


    Private Sub Form_Load()
    Dim Contex As String

    Contex = fGetstring1(HKEY_LOCAL_MACHINE, "Novell","Location", "Profiles","Services","{1E6CEEA1-FB73-11CF-BD76-00001B27DA23}","Default","Tab1")
    Label10 = Contex
    End Sub

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    Try this one ...
    Attached Files Attached Files

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

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