If you know the pane where the view was added.
I have tried this but I only get the size of the view after it is added to
the splitter pane.
The problem seems to be, or at least my problem which could be self
induced, is that I create a static splitter window (CSplitterWnd) and then
add the views. These views are added by a CRuntimeClass pointer, hence
there is no tangible CView at this stage to run the GetClientRect() on.
When you add the view you specify a size parameter to AddView() which I do
not know how to fill in, hence the original problem.
To get around this I thought I could just come up with a size for the
create view and then adjust it later with the SetRowInfo(), etc calls. So
once I have added the view I can get the CWnd for the view with GetPane()
and this is then my tangible view created for the splitter. However if I
now lookup the size of this view it reports the splitter pane size I set
when I added the view rather than the original size if the view.
Surely I am doing something obviously wrong here as this cannot be that
difficult! The problem as I see it is that I never create the view
instance in my code and hence cannot do the size lookup there. The view
create is hidden inside the splitter class AddView() call.
P.S. As far as I could tell you posted the reply to me to the newsgroup
not to my email, so I don't understand the thread comments after.
Ajay Kalra wrote:
On Apr 1, 12:20 pm, David Bilsby <d.bil...@virgin.net> wrote:
Sorry I probably was not clear enough.
I want to be able to call the SetRowInfo/SetColumnInfo members,
I do not know what size the CFormView is. If I try and call
GetClientRect() it simply returns the size of the splitter pane which
may be bigger or smaller than the CFormView it contains. I just want to
be able to find the size of the CFormView as set in the resource
template and then size my main window and the splitter panes
Hope that makes more sense.
Jonathan Wood wrote:
I'm not certain I understand exactly. Can't you just call
SetRowInfo/SetColumnInfo and then RecalcLayout?
It's hard to say without seeing what you are describing but isn't the
scroll range determined by the CFormView? You just need to tell the
If you call GetClientRect on the view itself, you should get the right
size. Where are you calling this from?