Error at a time of creating instance of form

  • Thread starter trialproduct2004
  • Start date
T

trialproduct2004

Hi all
I am having problem in dot net application.
I am getting lots of errors while running this application. But no
exact sceanario is found.
First error i am getting is 'error in creating window handle' at a time
of creating instance of form using new . Which is occuring if i run
application continuously for nearly 30 minutes or for 1 hour. I am not
getting whethere there is any mistake in my code.

Secondly i am getting error as 'object reference not set to an instance
of an object' which is also not coming continuously. Is it a memory
related issue. Becasuse both of these errors are not coming continusly.
Please help me becasue these are very very major isseues for me and
both these errors are decreasing performance of my application.

thanks in advance.
 
W

Wiktor Zychla

I am having problem in dot net application.
I am getting lots of errors while running this application. But no
exact sceanario is found.
First error i am getting is 'error in creating window handle' at a time
of creating instance of form using new . Which is occuring if i run
application continuously for nearly 30 minutes or for 1 hour. I am not
getting whethere there is any mistake in my code.

we have observed that such behaviour can be caused by child controls beeing
unable to initialize properly. for example, if a combo is populated with
custom objects inside form's constructor and the ToString() method of an
object fails (throws an exception) then the exception is swallowed by
System.Windows.Forms and, instead, "error creating window handle" is thrown
to the client. my first idea would be then to carefully examine all controls
that are populated when a form is initialized.

another probable cause of "error creating window handle" is just literal -
the OS cannot create another window handle because you have system object
leaks in your application (for example GDI handles or window handles). use
task manager to examine how many GDI and USER object your application
creates and whether these objects are properly destroyed when no longer
used.
Secondly i am getting error as 'object reference not set to an instance
of an object' which is also not coming continuously. Is it a memory
related issue. Becasuse both of these errors are not coming continusly.
Please help me becasue these are very very major isseues for me and
both these errors are decreasing performance of my application.

when the exception is thrown, look at its stacktrace. this will help you to
locate the mistake in your code.

Wiktor Zychla
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top