Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Where to get the initial client area rectangle of an CFormView?
Because calling GetClientRect from OnIntialUpdate will give me a 0 (ZERO) size rectangle

Help me please

Thank you for your understanding.
Posted
Updated 10-Oct-13 8:51am
v5

1 solution

You cannot get the rectangle until the window is visible. OnIntialUpdate is too early, see http://msdn.microsoft.com/en-us/library/xc7fw3a0(v=vs.90).aspx[^].
 
Share this answer
 
Comments
Mr. Tomay 11-Oct-13 11:58am    
I thought that OnInitialUpdate is equivalent to the OnInitDialog but it is intended for form views

Also what about the resource template rectangle !? because this is what i need before the view is re-sized & the template rectangle is changed
Richard MacCutchan 11-Oct-13 12:34pm    
As the document says, the GetClientRect function will only return the size after the window has been displayed. You also need to be aware that the dimensions can change any time the user resizes the main window, so these values should not be saved.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900