By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,962 Members | 2,545 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,962 IT Pros & Developers. It's quick & easy.

Exception with User-defined Control

P: n/a
Hello,

I'm getting following exception while setting myUsrCtrl.Visible = true.

System.OutOfMemoryException: Error creating window handle. --->
System.NullReferenceException: Object reference not set to an instance of an
object.
at System.Windows.Forms.UnsafeNativeMethods.IntCreate WindowEx(Int32
dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32
x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef
hMenu, HandleRef hInst, Object pvParam)
at System.Windows.Forms.UnsafeNativeMethods.CreateWin dowEx(Int32
dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32
x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef
hMenu, HandleRef hInst, Object pvParam)
at System.Windows.Forms.NativeWindow.CreateHandle(Cre ateParams cp)
--- End of inner exception stack trace ---
at System.Windows.Forms.Control.SetVisibleCore(Boolea n value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
This is not a normal behaviour, also i'm using native activeX control in
same project. This exception is regularly coming after accessing activex and
then setting myUsrCtrl.Visible = true. Any dependency or something? Can't
really figure out any suggestion?

Thanks in advance.
Divyesh
Sep 28 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.