Question

I have code below which has been working on devices of type Windows Mobile 5 and 6.1

private const string OwnerSubKey = @"ControlPanel\Owner";
regKey = CERegistry.CurrentUser.CreateSubKey(OwnerSubKey);

When I have a 6.5 device cradled and the debugger hits the line above, I get

"Type: System.Runtime.InteropServices.ExternalException

MESSAGE: Error writing to the RegistryKey

STACK TRACE: at OpenNETCF.Desktop.Communication.CERegistryKey.SetValue(String name, Object value) "

I am not sure what has changed between 6.1 and 6.5 or is it a setting on the device. SOTI was able to manipulate the registry.

I also tried the code below with same exception on the CreateSubKey.

var controlPanel = CERegistry.CurrentUser.OpenSubKey(@"ControlPanel", true);
var key = controlPanel.CreateSubKey("Owner");

If I do a GetSubKeyCount() it rightly returns the count.

Any help is appreciated.

Thanks

Was it helpful?

Solution 2

I was unable to write to the registry on the 6.5 device using opennetcf.

I ended up moving the information currently in the registry into a config file that opennetcf could write to.

Has to make this change to the legacy application.

OTHER TIPS

Set Key or Create Key is not working on WM 6.5. What I did is, created a reg file and merged it creating a process of regmerge application which can merge reg files in silent mode, so user will not get a confirmation prompt.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top