C
CedricCicada
I am developing a stock market simulator using data from Yahoo's
Finance page. I am using a web browser control hosted on a form that
has a public method named GetPage(), which takes a URL. I want
GetPage() to call m_browser.Navigate() and then wait for the
DocumentComplete event. The DocumentComplete event handler will store
the inner text of the body of the returned document and then wake up
GetPage(), which will then return the text to its caller.
I thought I could use a ManualResetEvent object named m_dataReceived to
manage this. After Navigate(), I call m_dataReceived.Reset() and then
m_dataReceived.WaitOne(). In the DocumentComplete event handler, I
call m_dataReceived.Set(). However, the event handler never runs. If
I take out the events and just let things happen when they want to, I
get the data from the web page.
What am I doing wrong?
Thank you very much.
Rob Richardson
Finance page. I am using a web browser control hosted on a form that
has a public method named GetPage(), which takes a URL. I want
GetPage() to call m_browser.Navigate() and then wait for the
DocumentComplete event. The DocumentComplete event handler will store
the inner text of the body of the returned document and then wake up
GetPage(), which will then return the text to its caller.
I thought I could use a ManualResetEvent object named m_dataReceived to
manage this. After Navigate(), I call m_dataReceived.Reset() and then
m_dataReceived.WaitOne(). In the DocumentComplete event handler, I
call m_dataReceived.Set(). However, the event handler never runs. If
I take out the events and just let things happen when they want to, I
get the data from the web page.
What am I doing wrong?
Thank you very much.
Rob Richardson