Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi@all!

 

i dont know whats wrong, the error is: "object reference is not set to an instance of an object"

 

  Dim key As Microsoft.Win32.RegistryKey

   Dim sKey As String = "Software\Microsoft\Windows NT\Current Version\Print\Acrobat Distiller"
   Dim sEntry As String = "Port"
   Dim sValue As String = "d:\*.pdf"
   Dim temp As String


   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

       key = Registry.LocalMachine.OpenSubKey(sKey, True)
       key.SetValue(sEntry, sValue)
       key.Close()
     
   End Sub

 

but isnt my variable key an instance of Microsoft.Win32.RegistryKey?

 

hope u can help me out here

 

thx in advance

  • *Experts*
Posted
What line does it fail on? Are you sure that you point it to the right registry path because that code works, and the exception you get is thrown when there is no path like the one you specify.
Posted

hi there!

 

'key' was always nothing cuz my Registry-String wasnt correct :-\

 

it should be "....\CurrentVersion\..." (i am with stupid) ;)

 

thx for your reply!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...