I have created a windows service in C#, .net framework 1.1
The service makes a web request using the
mshtml.HTMLDocu ment.CreateDocu mentFromURL() function
Because this is not using Windows.Forms, I can't use the
Application.DoE vents() function while the request is completing. Is there
an equivilent function (call the CreateDocumentF romURL from a seperate
thread and spin it until Document.readyS tate != "complete"?
Or just use Windows Forms namespace to access the Application object?
thanks 3 9429
On Tue, 15 Feb 2005 08:22:40 -0500, James Dixon wrote: I have created a windows service in C#, .net framework 1.1
The service makes a web request using the mshtml.HTMLDocu ment.CreateDocu mentFromURL() function
Because this is not using Windows.Forms, I can't use the Application.DoE vents() function while the request is completing.
Why do you need to call DoEvents from a Windows Service? All that DoEvent
does is to tell your application's Windows to process events from the
message loop (those events can be eg Repaint Window or Move Window). In a
windows service you have no user interface, no windows and no message loop
so DoEvents won't do anything.
Is there an equivilent function (call the CreateDocumentF romURL from a seperate thread and spin it until Document.readyS tate != "complete"?
You could maybe precise a bit more what you are trying to achieve. I don't
see the point of launching a new thread and then simply loop until this
thread has finished its job. Use threads only if you need to do several
things in parallel.
I didn't know if the HTMLDocument needs some kind of external notification
to finish
so I'll just do this:
while (objDocument.re adyState != "complete")
{
// Application.DoE vents();
}
and when it is done looping, I can start parsing the doc
I'll let you know if it works
thanks
"Elp" <ro********@REM OVEME.hotmail.c om> wrote in message
news:1e******** *************** *******@40tude. net... On Tue, 15 Feb 2005 08:22:40 -0500, James Dixon wrote:
I have created a windows service in C#, .net framework 1.1
The service makes a web request using the mshtml.HTMLDocu ment.CreateDocu mentFromURL() function
Because this is not using Windows.Forms, I can't use the Application.DoE vents() function while the request is completing.
Why do you need to call DoEvents from a Windows Service? All that DoEvent does is to tell your application's Windows to process events from the message loop (those events can be eg Repaint Window or Move Window). In a windows service you have no user interface, no windows and no message loop so DoEvents won't do anything.
Is there an equivilent function (call the CreateDocumentF romURL from a seperate thread and spin it until Document.readyS tate != "complete"?
You could maybe precise a bit more what you are trying to achieve. I don't see the point of launching a new thread and then simply loop until this thread has finished its job. Use threads only if you need to do several things in parallel.
Elp,
I came across your post through a Google search. I am trying to create a Windows Service that generates keystrokes, namely, a PrtScr keystroke.
I came across the following code to do so:
'The second parameter (bScan) determines what
'to copy... passing 0& copies the screen or
'passing 1& copies the active form.
keybd_event vbKeySnapshot, 0&, 0&, 0&
'pause to let Windows update the clipboard
DoEvents
'retrieve the clipboard bitmap to the control
Image1.Picture = Clipboard.GetDa ta(vbCFBitmap)
The DoEvents command is not available in my service, and without it, the keystroke doesn't seem to be absorbed by Windows.
Do you have any suggestions? Pardon my naivety, I'm a complete newbie to VB.
Cheers,
Jon
On Tue, 15 Feb 2005 08:22:40 -0500, James Dixon wrote:
[color=blue]
> I have created a windows service in C#, .net framework 1.1
>
> The service makes a web request using the
> mshtml.HTMLDocu ment.CreateDocu mentFromURL() function
>
> Because this is not using Windows.Forms, I can't use the
> Application.DoE vents() function while the request is completing.[/color]
Why do you need to call DoEvents from a Windows Service? All that DoEvent
does is to tell your application's Windows to process events from the
message loop (those events can be eg Repaint Window or Move Window). In a
windows service you have no user interface, no windows and no message loop
so DoEvents won't do anything.
[color=blue]
> Is there
> an equivilent function (call the CreateDocumentF romURL from a seperate
> thread and spin it until Document.readyS tate != "complete"?[/color]
You could maybe precise a bit more what you are trying to achieve. I don't
see the point of launching a new thread and then simply loop until this
thread has finished its job. Use threads only if you need to do several
things in parallel.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: pberna |
last post by:
Dear all,
I built a Web Form application to start and stop a Windows Service remotely.
I successful tested the application on Windows 2000 server + IIS. I must
include the ASPNET user
to the Administration group (on server side) to have the necessary
authorization to start a Windows Service (I don't understand why "Power
User" rights are not enough to do the same thing)
Although I'm able to start a service using windows 2000 server...
|
by: Jim |
last post by:
I am writing a Windows Service in VB.Net, and right upfront I need to pass
the path to my config.xml file to the constructor of the class which reads
it. In the old days, App.Path & "\config.xml" would have done nicely. I have
tried using Reflection.Assembly.GetExecutingAssembly.Location but this is
horrible! I can't use the easy Application.Path property because it is a
service not a Forms application.
Is there a simple way to do this,...
|
by: Blaxer |
last post by:
I have read approximately 30 articles now on various methods to make your
vb.net application automatically update itself and I can't see how they apply
to a vb.net windows services projects. The goal of the project is to write a
windows service in vb.net that runs on many workstations that can
automatically update itself from a central web server or share (either or
doesn’t matter). I do not want the service to re-install itself each time...
|
by: James Dixon |
last post by:
I have created a windows service in C#, .net framework 1.1
The service makes a web request using the
mshtml.HTMLDocument.CreateDocumentFromURL() function
Because this is not using Windows.Forms, I can't use the
Application.DoEvents() function while the request is completing. Is there
an equivilent function (call the CreateDocumentFromURL from a seperate
thread and spin it until Document.readyState != "complete"?
|
by: Ludovic DE FREITAS |
last post by:
Hello,
I am making a prototype system with a Pocket PC that must connect to a
Server Application.
Unfortunately, the server cannot be a Web Server, but a simple Windows Forms
Application.
Here is my question:
The only way to easily communicate for a Pocket PC is the Web Service.
Is it possible to host a web service in a Windows Forms Application ?
| |
by: deko |
last post by:
When to use a privileged user thread rather than a windows service?
That's the question raised in a previous post . It was suggested that if the service needs to interact
with a WinForms app (which is the UI used to adjust the actions taken by,
and the schedule of the service), then a privileged user thread should be
used in the UI - no service required.
But...
"A windows service enables the creation of long-running executable
|
by: tshad |
last post by:
What would be a good way to check programmatically whether a service was
running?
We have a service that dies periodically and I need to check to see if this
service is running. I know how to check to see if the status is in stopped
or running mode. But that doesn't tell me if it is actually running.
I need to know this so that if it happens I can programmatically start the
same service on another machine.
|
by: shapper |
last post by:
Hello,
I usually develop Asp.Net 2.0 (With VB.NET or C#) web sites with SQL
2005 databases.
A few of my web sites use online CMS with AJAX.
I need to create a Windows Vista compatible application that includes
the features I usually have in my CMS:
1. Send a retrieve content from the web site SQL 2005 database.
|
by: =?Utf-8?B?TVNU?= |
last post by:
To demonstrate my problem, I have a very simple VB Windows application. It
has a text box that is used to display a counter, a button to reset the
counter, and a timer that increments the counter every second.
I remote desktop to the computer hosting this application and run the
application. It starts up and displays the counter incrementing every
second. If I disconnect the network cable between the two computers for 10
seconds and...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |