RegCreateKeyEx in CreateSubKey failing

Dec 3, 2009 at 11:01 PM

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(); 
rapi.Connect();
key = CERegistry.LocalMachine.CreateSubKey(aquariums);
key.SetValue("Temp", 450);
key.Close();

Now I get the following error from ASP.net

[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 3, 2009 at 11:31 PM

I have also tried to create a directory by

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

And that didn't work either

Dec 3, 2009 at 11:32 PM

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