Hi,

I am using the OpenNetCF Registry.cs. I have to store two types of values
into the registry. A string type and other Int type. I am successfully able
to write string values into the registry. But when I try to write an
interger into the registry it gives me some InvalidCast Exception.

I will tell you the steps, sorry i cant be exact because i am mailing from
my house and not from my work place.

1) CreateRegistryKey: This returns object of RegistryKey
2) RegistryKey.SetValue("KeyName" , intValue);
3) RegistryKey.Close();

I donno if I am missing something. But I am not able to overcome this error.

Any suggestions are welcomed.

thanks a lot in advance.

Amit.

Re: OpenNetCF Registry problem. by Paul

Paul
Fri Jul 09 16:19:19 CDT 2004

What have you tried? Changing "KeyName" (which should be "ValueName", not
"KeyName", probably)? How is intValue declared? Int? It needs to be
Int32.

Paul T.

"Amit Patankar" <amit_v_patankar@yahoo.com> wrote in message
news:%23GhzsBfZEHA.3140@TK2MSFTNGP10.phx.gbl...
> Hi,
>
> I am using the OpenNetCF Registry.cs. I have to store two types of values
> into the registry. A string type and other Int type. I am successfully
able
> to write string values into the registry. But when I try to write an
> interger into the registry it gives me some InvalidCast Exception.
>
> I will tell you the steps, sorry i cant be exact because i am mailing from
> my house and not from my work place.
>
> 1) CreateRegistryKey: This returns object of RegistryKey
> 2) RegistryKey.SetValue("KeyName" , intValue);
> 3) RegistryKey.Close();
>
> I donno if I am missing something. But I am not able to overcome this
error.
>
> Any suggestions are welcomed.
>
> thanks a lot in advance.
>
> Amit.
>
>