473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Application.DoEvents in a service

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
Nov 20 '05 #1
3 6373
"Peter B Rasmussen" <pe***@zonecreator.com> 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

Nov 20 '05 #2
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
Nov 20 '05 #3
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" <pe***@zonecreator.com> wrote in message
news:Ol**************@TK2MSFTNGP09.phx.gbl...
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
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

24
by: bazad | last post by:
Hi, I'd like to understand consequences of Application.DoEvents call. Does it create a new thread? Thank you
6
by: foldface | last post by:
Hi I am doing drag and drop between controls (listview and treeview) using mouse_event. What I am after is a book/resource to explain the behaviour below. If I do the various Win32 api calls...
6
by: Ollie Riches | last post by:
I understand the use of Application.DoEvents() to process all outstanding messages on the message queue in a winforms application if you have long running process on the UI thread. But can anyone...
3
by: Wolfgang Kutschera | last post by:
Greeting folks! This question has been asked before, but unfortunately never really been answeared. I would appreciate to get any clous on how to solve the problem: I am writing a windows...
1
by: RSH | last post by:
I created a new Windows Form project and I created a simple richtextbox to write to and I am looping through a simple example but obviously the screen isn't updated it only shows the first...
13
by: Amjad | last post by:
Hi, Is there an equivalent to the "Application.Doevents" method in modules or Windows services? I want to make a Windows service that calls a DLL. The DLL would have all my functions and it...
5
by: james.jdunne | last post by:
System.ArgumentException: Item has already been added. Key in dictionary: "-1" Key being added: "-1" at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add) at...
16
by: Alan T | last post by:
I tried to use a thread to process a iterative execution of processes but afraid my thread is not thread-safe. If I am not using a thread, my main form will become 'white' when switch forth and...
4
by: Woo Mun Foong | last post by:
Hi, I have a DLL that is used to carry out some lengthly process. I would like to have something similar to DoEvents that can yield control back to Windows every now and then. Any ideas ? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.