Results 1 to 5 of 5

Thread: How Can I [UNRESOLVED]

  1. #1

    Thread Starter
    New Member Masta's Avatar
    Join Date
    Aug 2003
    Posts
    13

    How Can I [UNRESOLVED]

    Make a REG_DWORD Vaule in the Registry it make Reg_RZ

    If any1 can help please do
    Last edited by Masta; Sep 4th, 2003 at 03:49 PM.

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Are you sure you are not setting a larger than Integer (Int32) value to it?
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  3. #3

    Thread Starter
    New Member Masta's Avatar
    Join Date
    Aug 2003
    Posts
    13
    well I have a code that takes and makes a REG_RZ I'm new to programming...I am learning alto with the codes I find around the internet and I have no idea what (Int32) is.... Please bare with me....

  4. #4
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    In visual basic .net Int32(Integer) is a data type. It refelcts a 32 bit signed number, ranging from negative 2,147,483,648 through positive 2,147,483,647.
    If you set the value of a regisrty key to an Int32, then it will be a Reg_DWORD, but trying to assing larger numbers causes the registry key to change to REG_RZ.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

  5. #5

    Thread Starter
    New Member Masta's Avatar
    Join Date
    Aug 2003
    Posts
    13
    thank you but I'm trying to set the value to 1 which means on

    if I take and set it to Int do you think it will work?

    here is the code that I'm working with

    Select Case cmbHKey.Text
    Case "CurrentUser"
    MyRegistryObject = Microsoft.Win32.Registry.CurrentUser
    End Select
    If NoRecentDoc.Checked = True Then
    MyRegistryObject.CreataSubKey(txtSubKey.Text)
    Dim TempReg
    TempReg = MyRegistryObject.OpenSubKey(GetKeyFromString(txtSubKey.Text), -1)
    TempReg.SetValue(GetSubKeyFromString(txtSubKey.Text), txtValue.Text)
    TempReg.Close()
    End If

    Private Function GetKeyFromString(ByVal KeyString As String)
    Dim sLoc
    sLoc = InStrRev(KeyString, "\")

    If sLoc = 0 Then
    GetKeyFromString = KeyString
    Else
    GetKeyFromString = Microsoft.VisualBasic.Left(KeyString, sLoc - 1)
    End If
    End Function
    Private Function GetSubKeyFromString(ByVal KeyString As String)
    Dim sLoc
    sLoc = InStrRev(KeyString, "\")

    If sLoc = 0 Then
    GetSubKeyFromString = KeyString
    Else
    GetSubKeyFromString = Microsoft.VisualBasic.Right(KeyString, Len(KeyString) - sLoc)
    End If
    End Function
    Last edited by Masta; Sep 5th, 2003 at 12:20 PM.

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