mshtml and windows services

  • Thread starter Thread starter Robert May
  • Start date Start date
R

Robert May

I have an application that uses the Ax web browser object. When I call the
IHTMLElement.click() method on an input button (<input type="submit"> or
<input type="button">), the click fires appropriately, if I'm running it
from a windows forms based application.

However, when I run the EXACT same code under a windows service, either as a
logged in user or as the local system account, the click fails to process.
Clicking on other elements (like <a>) works.

I've tried submitting the form directly, in cases where a submit occurs, but
can't do that either. Both GET and POST actions fail.

What am I doing wrong? Is there something that prohibits the onclick event
from firing for buttons when running as a service? Am I missing something?

Robert
 
Robert,

Using the Web Browser object in a service requires interaction with the
desktop. In general, this is a bad idea.

If you are just looking to submit information to websites, then you
might want to use the HttpWebRequest and HttpWebResponse classes instead.
They don't require interaction with the desktop.

Hope this helps.
 
Back
Top