Application.DoEvents() in a Windows Service? + Other Questions


  • Is it possible to use Application.DoEvents() in a Windows Service? I am currently getting a blue squiggle saying

    Name 'Application' is not declared

    Additionally, I have placed a timer and a textbox field on the designer and getting build errors stating:

    Error    1    Reference required to assembly 'System.Drawing, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' containing the type 'System.Drawing.Point'. Add one to your project. C:\Documents and Settings\Onam\Desktop\projects\themsnblocker\themsnblocker\Service1.Designer.vb    51    9    themsnblocker

    This is my first time using the Windows Service feature and need some guidance please Smile

    Wednesday, January 16, 2008 4:10 PM


  • You should take at look at the MSDN Library documentation for the WindowsService project type.


    A Service is a special kind of application that does not have a user interface.  It is meant to run silently in the background, doing its work.  Since it does not have a UI, it is not meant to interact with the desktop.  So you won't have any "Form" objects in a Service project.  You can add components to the designer, but not controls.


    To configure your service or allow the user to interact with it, you create a second project that is a WindowsApplication and use a ServiceController component to create a service manager application.  The MSDN documentation explains the restrictions of a service and the interaction of a service manager application.

    Wednesday, January 16, 2008 4:59 PM