L
Leszek Gruszka
When i'm trying to retrieve string key from registry that was never written,
i've got a trash string and error that "Cast from string ""?????????" to
type 'Double' is not valid.
It's everytime, that key was never use (defined).
In key is value "Brak tekstu". Where is a problem?
Function LegalNoticeCaption(ByVal strKomputer As String)
Dim oreg
oreg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
strKomputer & "\root\default:StdRegProv")
Dim dwValue = Nothing
Dim vLegalNoticeCaption = Nothing
Dim strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Policies\System"
Dim strValueName = "LegalNoticeCaption"
oreg.getStringValue(HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue)
If dwValue Is Nothing Then
vLegalNoticeCaption = "empty"
Else
dwValue = vLegalNoticeCaption
End If
MsgBox(dwValue)
End Function
i've got a trash string and error that "Cast from string ""?????????" to
type 'Double' is not valid.
It's everytime, that key was never use (defined).
In key is value "Brak tekstu". Where is a problem?
Function LegalNoticeCaption(ByVal strKomputer As String)
Dim oreg
oreg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
strKomputer & "\root\default:StdRegProv")
Dim dwValue = Nothing
Dim vLegalNoticeCaption = Nothing
Dim strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Policies\System"
Dim strValueName = "LegalNoticeCaption"
oreg.getStringValue(HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue)
If dwValue Is Nothing Then
vLegalNoticeCaption = "empty"
Else
dwValue = vLegalNoticeCaption
End If
MsgBox(dwValue)
End Function