-
June 4th, 2009, 08:34 PM
#1
Program Startup - WM_OnSize message
in my OnSize message handler, I have this code:
Code:
m_WebBrowser1.put_Width(cx);
m_WebBrowser1.put_Height(cy);
^ it resizes the WebBrowser control in a way that it takes up the whole dialog window.
If user resizes a window, webbrowser changes its size as well.
Here is the problem: when the program starts, I get 2 exactly the same errors:
DEBUG ASSERTION FAILED
winocc.cpp... line 373.....
I'm able to hit ignore twice and then the program runs normally, but why do I get these errors?
My guess is that I'm trying to use m_WebBrowser1 variable before it is declared. I could be wrong.
How would I fix it?
-
June 4th, 2009, 08:39 PM
#2
Re: Program Startup - WM_OnSize message
Did you notice the button that says click retry to debug?
-
June 4th, 2009, 08:40 PM
#3
Re: Program Startup - WM_OnSize message
yes, if I were to hit retry, the message goes away.
but why does the message appear? where is the problem?
-
June 4th, 2009, 11:44 PM
#4
Re: Program Startup - WM_OnSize message
The assertion is probably because the web browser window has not been initialized.
I don't remember if the web browser control has a m_hWnd member, but you could try this.
Code:
if (::IsWindow(m_WebBrowser1.m_hWnd)
{
m_WebBrowser1.put_Width(cx);
m_WebBrowser1.put_Height(cy);
}
-
June 5th, 2009, 11:25 AM
#5
Re: Program Startup - WM_OnSize message
yup, the ::IsWindow check solved the problem
Thanks for help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|