pete69 Posted October 23, 2003 Posted October 23, 2003 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 Quote
*Experts* mutant Posted October 23, 2003 *Experts* Posted October 23, 2003 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. Quote
pete69 Posted October 23, 2003 Author Posted October 23, 2003 hi there! 'key' was always nothing cuz my Registry-String wasnt correct :-\ it should be "....\CurrentVersion\..." (i am with stupid) ;) thx for your reply! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.