Quote Originally Posted by ProgramArtist View Post
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