Registry - export subkey ?

  • Thread starter Thread starter dtdev
  • Start date Start date
D

dtdev

Hi,

Im using opennetcf on a mobile device for acessing the registry.

Is it possible programatically to export and import subkeys - and all its
values ?

I would like to export all of my settings into a file - which ultimately
could be reloaded again later on.

Have been looking at the RegistryKey - but apparently there is no function
to do this.

Hope you can help

Thanks,
 
There is no support to export or import but it should be pretty straight
forward to write that functionality.

Mark Arteaga
ng_[at]_neotericsdc_[dot]_com
 
You can save the whole registry with RegCopyFile, but that's a lot of data.
Why are you trying to do this?

Paul T.

Mark Arteaga said:
There is no support to export or import but it should be pretty straight
forward to write that functionality.

Mark Arteaga
ng_[at]_neotericsdc_[dot]_com

dtdev said:
Hi,

Im using opennetcf on a mobile device for acessing the registry.

Is it possible programatically to export and import subkeys - and all its
values ?

I would like to export all of my settings into a file - which ultimately
could be reloaded again later on.

Have been looking at the RegistryKey - but apparently there is no
function
to do this.

Hope you can help

Thanks,
 
Two reasons why i want this; the mobile device im using doesnt save the
registry on the flash (douh!), which means that we are loosing the registry
everytime that it experiences a cold-boot :( - second reason is that i would
like to export the configuration and probably import it also.

Doing the whole registry isnt an option since there is unit-dependant
information in there too.

I know its possible to do it on a normalt windowsplatform, using:

RegCreateKeyEx
RegRestoreKey
RegSaveKey
RegOpenKeyEx

And just experienced that apparently in EVC (CE) enviorment im not able to
use the RegRestoreKey () and RegSaveKey() ? so i cant use that approch ?

Thanks,
 
What device are you using?
The first issue could be negated if you're on 5450/5550 HPs - their
backup software is great, infinately better than the 3700 series
version. The whole PDA can be backed up and, if required, compressed
onto an SD card (or CF if you have the expansion jacket) and restored
after a cold-boot or dopey user not recharging the damn thing...
It includes the whole registry so all the partnership info is saved too
- a god send for people that sync remotely.


Paul
 
Well doesnt matter which device im using (its an industrial device), since
its unfortunately how it has been made - and the hardware is chosen by the
customer, not by me.

Knows lots of products which ofcourse HAS the capabillity, this
unfortunately doesnt, and no software is supplied to fix this issue.

Therefore i have to write my own, in somekind of way ?

(i know that EVC doesnt have anything to do with CF - but had to try
something, since i wanted to make an external program, which my C# could
call - but since the support apparently lacks for some API functions on CE,
it wasnt succesfull).
 
My suggestion is you design your own object for holding the data and
exposing it via properties.

Add a couple of methods to the object ReadFromReg, WriteToReg and use that
object throughout your code and not the reg direct. You can also add to the
object a couple of methods ReadFromFile, WriteToFile and then the file
format is up to you (e.g. csv). You could even use a dataset internally to
the object and leverage its capabilities to import/export to XML.

Cheers
Daniel
 
Then whether you can use RegSaveKey or not is dependent on what form of
registry they are using. We always use the RAM-based registry and arrange
for saves of the RAM-based registry to non-volatile storage automatically.
In that case, you aren't able to use RegSaveKey (but, of course, it's
already in non-volatile storage). If your device is using hive-based
registry, you *can* use RegSaveKey. Sounds to me like you really need to
contact the manufacturer and ask them how best to save the registry to
non-volatile storage...

Paul T.
 
Back
Top