Login | |
|
 |
RE: Getting Data of a Registry Value - 5/14/2008 3:21:44 AM
|
|
 |
|
| |
ebgreen
Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
|
You've got several issues here. First, your cases are mixed up: Case REG_SZ oReg.GetExpandedStringValue HKEY_CURRENT_USER,strKeyPath, arrValueNames, arrValueTypes , arrValueData MsgBox "Name: " & arrValueNames(i) & vbtab & "Data Type: Expanded String" & vbtab & "Data: " & arrValueData You are trying to use GetExpandedString to get a string. Let's assume you fix that and look at the way that you actually try to call GetStringValue: oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath, arrValueNames, arrValueTypes , arrValueData GetStringValue takes 4 parameters: uint32 GetStringValue( [in] uint32 hDefKey = 2147483650, string sSubKeyName, string sValueName, string sValue ); First, you are trying to pass it 5. Next, parameter2 through 4 are strings. For paramter 2 you are indeed passing it a string. For parameter 3 and 4 you are trying to pass it an array. So lets straighten those issues up: oReg.GetStringValue HKEY_CURRENT_USER,strKeyPath, arrValueNames(i), arrValueData(i) Ok, now look at that last parameter that you are passing in. You are treating it as an array (at least based on what you named it) but you never actually make it an array. To make it an array that is the same size as the other two arrays that you are using, put this line immediately before the For statement: ReDim arrValueData(UBound(arrValueNames))
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|