Access Registry

  • Thread starter Thread starter glenn
  • Start date Start date
G

glenn

I noticed that the OpenNETCF components also have a class for accessing the
registry on the PDA. However, when I follow along with their demo, I can
get it to run through the code but nothing seems to get stored in the
registry.

I then went to open their demo for the registry program and it tells me that
I don't have the components registered but when I click on the Project / Add
Reference I don't see the components listed. Which confuses me because in
my application they are listed for me to select.

Why would one project list them and another not?

Thanks,

glenn
 
How did you install the OpenNETCF dlls to your development machine? If you
install the regular binary package of the SDF it will att the libraries into
your Visual Studio folders so that they are always listed in the Add
Reference dialog for Smart Device projects.

Peter
 
I downloaded the binarys and source from their site. It was an install
program that I ran and it went through everything to install. Once it
finished I ran VS and everything was working. That is the only project that
I do not see the references listed in and its the only one I can't get to
compile...

glenn
 
And this is definately a Smart Device project, not a desktop Windows
Application or Class Library project.

Peter
 
Well, I am assuming since its not my project. its the registry project from
off their website.

glenn
 
I think it may be that the Registry sample on the site was written with an
older version of the library. If you remove the reference to
OpenNETCF.Win32.Registry and replace with a reference to OpenNETCF it should
build correctly against the current v1.2 release.

Peter
 
Well that got the program compiling and all is great on that front, however,
I have one more question.

When I execute the test application everything works perfectly, but when I
take 100% of the code found in form1 and transfer it into my application I
have the following things happen.

1) I can not execute the Win32 call without preceeding it with the full unit
name as well. Is there something you have to do with the namespace to get
my form to be able to just call the class without having to put the full
name. I don't see anything special in form1 so I'm confused at how it
handles this.

2) If I execute the code I have, everything runs and no errors are generated
but the line that actually creates the registry handle returns a zero 100%
of the time. And like I said, I have only copied the text from the one
program into another to test.

Thanks,

glenn
 
You can add

[C#]
using OpenNETCF.Win32;

[VB]
Imports OpenNETCF.Win32

To the top of your code file and then you can refer directly to the Registry
and RegistryKey without writing the namespace in full each time.

For your second query can you post a code snippet to duplicate the problem.

Peter
 
First of all, I already have the using clause exactly as you have it at the
top of the unit but it still will not let me reference the function
directly.

Secondly, I took the code example supplied on the OPENNETCF website for
working with the registry. Added the code to my unit along with the using
clause and compiled and ran. I get no errors but the registry values are
not getting saved because the registry create line is not returning a handle
in my code.

However, it does properly return a handle in the sample code which is what
is making be believe that I'm missing something somehwere.

Thanks,

glenn
Peter Foot said:
You can add

[C#]
using OpenNETCF.Win32;

[VB]
Imports OpenNETCF.Win32

To the top of your code file and then you can refer directly to the Registry
and RegistryKey without writing the namespace in full each time.

For your second query can you post a code snippet to duplicate the problem.

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

glenn said:
Well that got the program compiling and all is great on that front,
however,
I have one more question.

When I execute the test application everything works perfectly, but when I
take 100% of the code found in form1 and transfer it into my application I
have the following things happen.

1) I can not execute the Win32 call without preceeding it with the full
unit
name as well. Is there something you have to do with the namespace to get
my form to be able to just call the class without having to put the full
name. I don't see anything special in form1 so I'm confused at how it
handles this.

2) If I execute the code I have, everything runs and no errors are
generated
but the line that actually creates the registry handle returns a zero 100%
of the time. And like I said, I have only copied the text from the one
program into another to test.

Thanks,

glenn
/
Add
 
Back
Top