|
-
August 24th, 2009, 04:22 AM
#3
Re: CStatic GetClientRect Acts weird
 Originally Posted by ProgramArtist
The dialog window must be created before calling GetClientRect() of it or of it's members.
Code:
if (m_st1.GetSafeHwnd())
{
m_st1.GetClientRect( &rectStaticClient );
}
else
{
// not created yet.
}
Windows does not know the size of the controls before the dialog window has been created.
Btw: In a debug session you should get an assertion. Did you try to debug it?
With regards
Programartist
Hi and thanks for your quick and practical answer,
I did try to debug it and did not get an assertion. I new to MFC, so Ill have to ask when exactly a picture control, which is part of a dialog is created, and if I would like to get the rectangle of this picturebox, how can I do it after all ?
Thanks
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
|