R
René Iversen
Hi,
I've begun programming C# a few days ago, and now I'm experiencing a problem
I really don't understand.
I've create a new Windows Application project in Visual Studio .NET and my
Main method looks like this:
public static void Main( string[] args )
{
ProgramFrame pf = new ProgramFrame();
LogHandler.getInstance().registerLog( new ScreenLog( pf.LogArea ) );
LogHandler.getInstance().registerLog( new OutputLog() );
new Thread( new ThreadStart( Server.Server.getInstance().run ) ).Start();
Application.Run( pf );
}
pf is a System.Windows.Forms.Form object containing a RichTextBox (LogArea)
When the server thread starts it uses the singleton instance of LogHandler
to write som text to the RichTextBox and I get the following error:
An unhandled exception of type System.InvalidOperationException occured in
system.windows.forms.dll
Additional information: Window handle already exists.
Can anyone please explain to me, why this isn't possible, and what can I do
to make it work?
Best regards,
René
I've begun programming C# a few days ago, and now I'm experiencing a problem
I really don't understand.
I've create a new Windows Application project in Visual Studio .NET and my
Main method looks like this:
public static void Main( string[] args )
{
ProgramFrame pf = new ProgramFrame();
LogHandler.getInstance().registerLog( new ScreenLog( pf.LogArea ) );
LogHandler.getInstance().registerLog( new OutputLog() );
new Thread( new ThreadStart( Server.Server.getInstance().run ) ).Start();
Application.Run( pf );
}
pf is a System.Windows.Forms.Form object containing a RichTextBox (LogArea)
When the server thread starts it uses the singleton instance of LogHandler
to write som text to the RichTextBox and I get the following error:
An unhandled exception of type System.InvalidOperationException occured in
system.windows.forms.dll
Additional information: Window handle already exists.
Can anyone please explain to me, why this isn't possible, and what can I do
to make it work?
Best regards,
René