Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft C# .NET
Application.Run and Windows Service (Multithreaded)
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Jake K, post: 9596672"] I have a multithreaded application that I now want to convert into a Windows Service. Does application.run work in a windows service? Are there things to take into consideration when creating a multithreaded windows service as opposed to a multithreaded windows forms application? E.G. namespace whatever { public partial class Form1 : Form { .... public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { SomeArray = new SomeClass[# - #]; for (...) { ... ... ThreadStart ts = new ThreadStart(SomeClass.SomeMethod); Thread wrkThread = new Thread(ts); whatever.CurrentThread = wrkThread; wrkThread.SetApartmentState(ApartmentState.STA); wrkThread.Start(); } return; } } public class SomeClass { // ... // ... private void SomeMethod() { .... .... Application.Run(); } } } [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft DotNet
Microsoft C# .NET
Application.Run and Windows Service (Multithreaded)
Top