You have to initialize the string variable to a set of spaces or NULL
characters, and specify the length of the string in the "s" variable. Add
these two lines of code right before the function call:
pasd = Space$(1024)
s = 1024
Also, when you call the function as a sub, without capturing the return value,
do not use parentheses around the argument list:
regqueryvalue arr, "get", pasd, s
Lee Weiner
weiner AT fuse DOT net
http://home.fuse.net/lweiner
Quote:
>I have a problem accessing the Registry from Vb6.0. I am using the
>registry function regqueryvalue. its return value is error_success but
>its not returning the string from the registry. storing is no problem.
>I have declared a string variable
>It reads as
>Private pasd as string, private s as long
>The function is
>regqueryvalue(arr,"get",pasd,s)
>where arr is the handle to the key obtained by regcreatekey
>and get is the subkey
>Please help. thanks in advance for an urgent reply. please reply at
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.