Registry Problem 
Author Message
 Registry Problem

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.*-*-*.com/
Share what you know. Learn what you don't.



Sun, 02 Dec 2001 03:00:00 GMT  
 Registry Problem
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.



Sun, 02 Dec 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Registry Problems Help Please! - registry.bas (0/1)

2. Registry Problems Help Please! - registry.bas (1/1)

3. MSCOMM32 control problems registry problems

4. Access Registry Problem

5. Object registry problem VB5/Off97/NT

6. registry problems on XP

7. registry problems

8. VB.NET Registry Problem

9. VB 5 Registry problem

10. More Registry Problems...

11. VB5 and Registry Problem

12. VB 4.0 & Win95 Registry problem

 

 
Powered by phpBB® Forum Software