I have a vb 6 app that uses the RegQueryValueEx function to get a value from a subkey.
The function is defined in a code module, and called from two locations, one on a form, the other in the same code module.
Note, that I call the exact same function from each location. When I call it from the form, on a command button click event, it returns the value properly. When I call it from the code module, it has some other information appended after the value.
For example, the value stored in the registry is named "File Path", with a value of "\\servername\sharename\" That is returned properly when called from the form, but "\\servername\sharename\ s h a r e n a m e " is returned when the same function is called from the code module.
The blanks in the appended info are chr(0)'s, so I can strip them off easily enough, but I would really like to know why this is happening.
The function is defined in a code module, and called from two locations, one on a form, the other in the same code module.
Note, that I call the exact same function from each location. When I call it from the form, on a command button click event, it returns the value properly. When I call it from the code module, it has some other information appended after the value.
For example, the value stored in the registry is named "File Path", with a value of "\\servername\sharename\" That is returned properly when called from the form, but "\\servername\sharename\ s h a r e n a m e " is returned when the same function is called from the code module.
The blanks in the appended info are chr(0)'s, so I can strip them off easily enough, but I would really like to know why this is happening.