2
Reply

Why do i get a System.NullReferenceException?

hey_mr_art

hey_mr_art

Jun 22 2004 4:56 AM
2.3k
Good Day, I have a dll that disables/enables the keyboard using the SetWindowsHookEx, CallNextHookEx and UnhookWindowsHookEx api's. Now when i run my program, at first it does what its suppose to do, for about 2 minutes more or less, my apllication will generate this error: /* An unhandled exception of type 'System.NullReferenceException' occurred in system.windows.forms.dll Additional information: Object reference not set to an instance of an object. */ The error points to this part of my code: static void Main() { try { Application.Run(new Form1()); } catch(Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); <------------- error } } Does this have anything to do with garbage collection? Arthur

Answers (2)