NullRef/NativeWindow Possible Exception

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by painetraine
When creating a new instance of the SyntaxEditor control in code, I will occassionally get the following exception:

System.NullReferenceException: Object reference not set to an instance of an object.
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Control.DefWndProc(Message& m)
at System.Windows.Forms.Control.WmUpdateUIState(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.ParkingWindow.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

I can reliably generate this exception in my code (although a blank tester app I can't) and this error always occurs on the following statement:

SyntaxEditor objEditor = new SyntaxEditor();

It may be something I am doing, but can you think of any reason why this exception would occur on the ctor for SE?


Comments (1)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
I'm not sure... we do have some code to intercept wndprocs for intelliprompt so they don't steal parent form focus. But that only gets instantiated when a member list, info tip, etc. are displayed, not in the SytnaxEditor constructor. Would you mind testing this in the version 2.5 pre-release for us? I can email you the location if you write me.

Actipro Software Support

The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.