Thank you !  That's exactly what the problem was.  I think I either need to
take a break or open up another can of Red Bull.  Thanks Mattias ! :)

-Pete

-----Original Message-----
From: dotnet discussion [mailto:[EMAIL PROTECTED]]On Behalf Of
Mattias Sjögren
Sent: Monday, April 22, 2002 5:35 PM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] Registry reading/writing question


Peter,

>     Every time I run this code I get an Unhindered Exception Error (the
>exact type is: System.NullReferenceException).  After doing some digging I
>found out that for some weird reason after the call to OpenSubKey() myKey
is
>still null.  Why is that ?  What am I doing wrong ?

I don't think the leading backslash should be there, try removing it

RegistryKey myKey = rootKey.OpenSubKey("Software\\MyApp", true);


Mattias

===
Mattias Sjögren
[EMAIL PROTECTED]

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to