I'm at msdn right now looking at this function and it says the third entry to RegSetValueEx MUST BE ZERO but you have it as 0L which isn't the same thing. To build on what kbw said passing a null terminator into the registry isn't needed unless the specific data type you are working with is NOT null terminated; which few of them aren't. I also think you're going to run into problems when passing that last argument, you do realize that there is a preset limit on the length of a registry entry in Windows right?
EDIT: Also what are the double colon "::" before you call the RegSetValueEx on line 28 for? That looks like something more in place in VB, are you sure you didn't copy that from the wrong source? I hate the new layout for MSDN to but you can set it up to only display in your desired language with just a few minutes of effort.
When I had read the existing value from the registry key, I made the Buffer the size of it. That was the fault, the buffer was too small for adding stuff and RegSetValueEx made strange behaviour then