I am trying to edit a dword value in the registry with the following code :


Dim hkey As Long
Dim c As Long
Dim r As Long
Dim s As String
Dim t As Long

r = RegOpenKeyEx(HKEY_CURRENT_USER, _
"Software\Microsoft\Windows\CurrentVersion\Internet Settings", 0, KEY_READ, hkey)

If r = 0 Then
c = 255
s = String(c, Chr(0))
r = RegQueryValueExString(hkey, "AutoConfigURL", 0, t, s, c)

s = ""
r = RegSetValueExString(hkey, "AutoConfigURL", 0, REG_SZ, s, Len(s) + 1)
End If
r = 0

If r = 0 Then
c = 255
s = String(c, Chr(0))
r = RegQueryValueExString(hkey, "ProxyServer", 0, t, s, c)

s = ""
r = RegSetValueExString(hkey, "Proxyserver", 0, REG_SZ, s, Len(s) + 1)
End If
r = 0

Dim lData As Long
If r = 0 Then
iDword = 0
r = RegSetValueEx(hkey, "ProxyEnable", 0&, REG_DWORD, lData, 0) '(hkey, "ProxyEnable", 0, REG_DWORD, iDword, 0)
End If

r = RegCloseKey(hkey)


I can save the string values but cant save the dword, please help