Serialcoder en Français Serialcoder in English
TEL : +33 (0)9 72 13 15 17

Windows Forms FAQ resources

18. Windows Forms Tips

18.18 Why would I be getting a NullReferenceException in Windows Forms with no application code in the call stack?


The CLR is catching an Access Violation that's being thrown from unmanaged code, and that is propogating up as a NullReferenceException. I've seen this happen with certain common control library windows types if an application such as spy++ is running, and I see this is the TreeView control that is having troubles with a mouse down. Have you done any modification to the control through P/Invoke methods?

(from sburke_online@microsoft..nospam..com on microsoft.public.dotnet.framework.windowsforms)