PC Review


Reply
Thread Tools Rate Thread

Application.DoEvents in a service

 
 
Peter B Rasmussen
Guest
Posts: n/a
 
      18th Nov 2003
Please Help i am going mad

I am converting an application to a service using vb.net.

My problem is that i can't import the system.windows.forms.

What can i call instead?

In the code below ReturnValue is updated by a timer event.

Code:
Do

Application.DoEvents()

Loop Until (InStr(StrReturnValue, StrFindString) Or InStr(StrReturnValue,
"ERROR"))

Thanks in advance.



PBR


 
Reply With Quote
 
 
 
 
Armin Zingler
Guest
Posts: n/a
 
      18th Nov 2003
"Peter B Rasmussen" <(E-Mail Removed)> schrieb
> Please Help i am going mad
>
> I am converting an application to a service using vb.net.
>
> My problem is that i can't import the system.windows.forms.
>
> What can i call instead?
>
> In the code below ReturnValue is updated by a timer event.
>
> Code:
> Do
>
> Application.DoEvents()
>
> Loop Until (InStr(StrReturnValue, StrFindString) Or
> InStr(StrReturnValue, "ERROR"))


The "technical" explanation for not being able to Import the mentioned
namespace may be that you don't reference a/the library containing the
namespace. Apart from that, a service doesn't/mustn't need a UI so there's
no need for system.windows.forms and doevents. You may write a service _and_
a WinForms app and have them communicate with each other.


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

 
Reply With Quote
 
Peter B Rasmussen
Guest
Posts: n/a
 
      18th Nov 2003
Thanks for the answer.

But i need a way to pause the process but still have the service application
running timers and stuff. Thats is my problem.

The program does not need an application frontend.

Thanks in advance

/Peter


 
Reply With Quote
 
Michael Pearson
Guest
Posts: n/a
 
      19th Nov 2003
You need multithreading!

Thread.Sleep() on the thread you want to pause

Multithreading is a pretty complicated thing. Do some reading on
multithreading and that should point you in the right direction.

Michael

"Peter B Rasmussen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks for the answer.
>
> But i need a way to pause the process but still have the service

application
> running timers and stuff. Thats is my problem.
>
> The program does not need an application frontend.
>
> Thanks in advance
>
> /Peter
>
>



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.538 / Virus Database: 333 - Release Date: 11/10/2003


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application.DoEvents() Equivalent in a Windows Service. Tino Donderwinkel Microsoft C# .NET 3 21st Mar 2008 02:52 PM
Windows Service and application.DoEvents() Wolfgang Kutschera Microsoft VB .NET 3 5th Apr 2005 03:01 PM
NotifyIcon Bug, Application.EnableVisualStyles, Application.DoEvents, and Memory Leaks Michael S. Malley Microsoft Dot NET 0 11th Mar 2004 08:43 PM
NotifyIcon Bug, Application.EnableVisualStyles, Application.DoEvents, and Memory Leaks Michael S. Malley Microsoft Dot NET Framework Forms 0 11th Mar 2004 06:22 PM
NotifyIcon Bug, Application.EnableVisualStyles, Application.DoEvents, and Memory Leaks Michael S. Malley Microsoft Dot NET Framework Forms 0 10th Mar 2004 09:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:50 AM.