RegCreateKeyEx in CreateSubKey failing

Dec 4, 2009 at 12:01 AM

Desktop: WinXP Professional SP3, ActiveSync 4.5.0

CE: Windows Embedded CE6.0


I am trying to create new registry keys and the c++ function fails, I can't figure out why.

Here is what I have:

static string aquariums = @"SOFTWARE\Aquarium";
rapi = new RAPI(); 
key = CERegistry.LocalMachine.CreateSubKey(aquariums);
key.SetValue("Temp", 450);

Now I get the following error from

[ExternalException (0x80004005): An error occured creating the registry key.]

When I go into debug all the way into Registry.c
int result = RegCreateKeyEx(...);

result get the value 0x80000002, which is the enum value for LocalMachine. I can't quite figure out what I am doing wrong here.

I also have some code on the CE side doing the following:
LPCTSTR lp_temp = argv;
if(RegCreateKeyEx(HKEY_LOCAL_MACHINE, lp_temp, 0, NULL, 0, 0, NULL, &this->h_key, &this->dw_Disposition) == ERROR_SUCCESS)
Which works fine.

Can anyone figure out the problem?

Dec 4, 2009 at 12:31 AM

I have also tried to create a directory by

rapi.CreateDeviceDirectory(@"\My Documents\Temp");

And that didn't work either

Dec 4, 2009 at 12:32 AM

Yeah figured it out, I was using SerialCable, MAKE SURE YOU HAVE THE SAME BAUD RATE!