Registry class problem.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I am using the Registry class of OpenNetCF. But when i call any method, it gives me MissingMethod exception. Could you tell me where I am going wrong? Or should i include something?

Also does anyone know how to use the class?

Thanks in advance.
Amit Patankar
 
Amit Patankar said:
I am using the Registry class of OpenNetCF. But when i call any
method, it gives me MissingMethod exception. Could you tell me where
I am going wrong? Or should i include something?

Also does anyone know how to use the class?

Sounds like it's not finding the assembly properly. Try copying the
OpenNETCF assembly to the same directory as your application.
 
Hi,
Could you please elaborate on what OpenNETCF assembly is? Do I require to install something? I just downloaded the Register.cs file and used it directly into my project. Do i have to do something else?

Thanks.
Amit Patankar
 
Amit Patankar said:
Could you please elaborate on what OpenNETCF assembly is? Do I
require to install something? I just downloaded the Register.cs file
and used it directly into my project. Do i have to do something else?

Ah, I assumed you'd downloaded the whole library (that's what most
people do). If you've just got Registry.cs, I would expect it to just
work, to be honest...

If you step through your code in the debugger, what line does the
MissingMethodException get thrown on?
 
I don't have it in front of me, but it might very well be using P/Invokes
which are declared in other .cs files. It's *not* the case that every .cs
file in OpenNETCF is intended to be use separately from every other one.

Use the debugger and trace into the method call. If you can't even make it
into the call which is defined in your project then you have some type of
referencing problem (you are referencing the main OpenNETCF library, but
haven't included it in your installation -- the .cs file is being ignored).
If you *can* step into it, tell us where it actually fails!

Paul T.
 
Paul G. Tobey said:
I don't have it in front of me, but it might very well be using P/Invokes
which are declared in other .cs files.

In that case it shouldn't even compile though, should it?
 
If the OpenNETCF stuff is on the development machine but, for some reason,
not installed on the device (maybe the EXE is being manually copied, rather
than deployed from VS.NET). I've done that before...

Paul T.
 
Also there are two fairly similar Registry.cs files in separate OpenNETCF
projects. The one in OpenNETCF.dll has the device side P/Invokes, the one in
the Communication project has the desktop RAPI versions and the class is
named CERegistryKey.

Peter

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

Paul G. Tobey said:
If the OpenNETCF stuff is on the development machine but, for some reason,
not installed on the device (maybe the EXE is being manually copied,
rather
than deployed from VS.NET). I've done that before...

Paul T.
 
You'ree obviously missing something. First, as Peter suggested, make sure
you're using the right file. We have one for the desktop (for RAPI) and one
for the device. Next you'll have to also include Core.cs becasue it has all
of the P/Invoke declarations used in Registry.cs

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
---
Principal Partner
OpenNETCF Consulting
www.OpenNETCF.com



Amit Patankar said:
The only thing i did was to include the class (.cs file) into my project.
One major thing i did was to change the namespace name from OpenNETCF.Win32
to my project namespace name...but even then i dont thing this should bother
much.
And then it isnt even instantiating. E.g.: RegistryKey myReistry = new
RegistryKey(..,..,..,..,); Its giving error here..forget about calling any
method.
 
Back
Top