Steve,
Calling the static Run method on the Application class isn't going to do
anything for you. What you have to do is set the thread up that you are
running your code on to join an apartment. Now, I believe that the calls to
your component for starting, stopping, pausing, etc, etc, will come in on
the same thread, so what you might want to do is set the apartment state
when the service starts (and you MUST do this before you create any COM
components), by setting the ApartmentState property to MTA or STA, depending
on whether or not you want a single-threaded apartment or to join the single
multi-threaded apartment for the process.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"SPG" <st*******************@nopoo.blueyonder.co.uk> wrote in message
news:Bv*********************@news-text.cableinet.net...
Hi,
We have a standard windows app writeen in C# that uses an ActiveX dll to
send us events. This works fine as a Windows app, but as soon as we
compile as a service, no more events.
I have been told that there is no message pump provided to the service,
and therefore the events from the dll cannot be serviced.
Has anyone ever come across this? How did you get around it?
I have tried creating a message pump using Application.Run() but I don't
think I am doing the right thing.
Any help would be greatly appreciated.
Steve