W
Will
I'm working on a C# Windows Service that needs to monitor serial port
communication. Because the .Net framework does not include support for
serial communications, I've decided to use the Microsoft Communication
Control (MSCommLib) that comes with Visual Studio 6. It seems easy to use
and works well enough for me within the context of a Windows Application.
Because I need the serial ports to be monitored 24/7, however, a Windows
Service seems like the better choice.
Because the MSCommLib control is an OCX, it needs to be placed on a Form.
I've added a Form that presumably won't be displayed during runtime to my
Windows Service project. At this point, with just a Windows Service and an
Empty Form, I am able to install and start the service with no problems.
After adding the MSCommLib Control to the form, however, when I start the
service I get an error message that says something like:
"Your Service started and then stopped. Some services do this"
Placing Event Log debug statements in the code reveals that the Service
never appears to return from the Form.InitializeComponents() function, in
which the MACommLib control is instantiated and initialized.
Does anyonone have any advice regarding my situation? Perhaps I am trying
to do the impossible...Any workarounds or alternate solutions for monitoring
a server's serial ports would be greatly appreciated.
Thanks,
Will
communication. Because the .Net framework does not include support for
serial communications, I've decided to use the Microsoft Communication
Control (MSCommLib) that comes with Visual Studio 6. It seems easy to use
and works well enough for me within the context of a Windows Application.
Because I need the serial ports to be monitored 24/7, however, a Windows
Service seems like the better choice.
Because the MSCommLib control is an OCX, it needs to be placed on a Form.
I've added a Form that presumably won't be displayed during runtime to my
Windows Service project. At this point, with just a Windows Service and an
Empty Form, I am able to install and start the service with no problems.
After adding the MSCommLib Control to the form, however, when I start the
service I get an error message that says something like:
"Your Service started and then stopped. Some services do this"
Placing Event Log debug statements in the code reveals that the Service
never appears to return from the Form.InitializeComponents() function, in
which the MACommLib control is instantiated and initialized.
Does anyonone have any advice regarding my situation? Perhaps I am trying
to do the impossible...Any workarounds or alternate solutions for monitoring
a server's serial ports would be greatly appreciated.
Thanks,
Will