Quote:
Originally Posted by Fаng
I think I get it. You all aren't concerned about having a GUI, you all are concerned that I don't know how to implement a GUI successfully. If the server was lagging, it wouldn't be the GUI's fault. That's not only because it's rare that the draw method is called, I dedicate a thread to the GUI. When I want to write a line to the "console", I invoke the thread. I tell the textbox holding the console lines to begin writing the line: "_outputTextBox.BeginInvoke(_writer, line);" It will never block the server. The COM threading model of the server is MTA. It's defined as an attribute on the main function. The server's thread is of the highest priority, while the GUI thread is not. The performance loss of having the GUI is so insignificant. The benefits of having the GUI and the ability for me to show my server in action to my professors in a clean way, outweigh the insignificant costs of running it.
|
[MTAThread] won't work for some controls. Plus, a GUI is useless for a server. Only commands are required. If you want a GUI, fine, but I would say, put all your output in the normal console. Not a fake one that requires much more for nothing. By building your application as a console app, you'll get both the GUI and a console.
Else, most services (httpd, mysql, etc) are process without any GUI. There is a reason :rolleyes:
Anyway, I understand the interest of having a GUI, but please, don't output everything in your fake console, use a real one. Plus, don't use MTAThread with WinForms. Microsoft doesn't support MTAThread with WinForms, so it's unsafe to use it. Just try some dialog, you'll see that the app will crash.
Quote:
|
Windows Forms is not supported within a MTA or free threaded apartment. Applications using Windows Forms should always declare the apartment style they're using, as some other component could initialize the apartment state of thread improperly.
|
[Only registered and activated users can see links. Click Here To Register...]