|
-
June 28th, 2003, 05:36 PM
#1
Two views in splitterwindow, same base class
Hello,
I was woondering how can I use the same class for 2 different views. I have a SDI application with splitter window and I want to use the same class called "CMyFormView" for both the views. Here is a creation code
Code:
.
...
......
........
......
.....
if(!m_wndSplitter2.CreateView(0, 0,RUNTIME_CLASS(CMyFormView), CSize(0, 400), pContext))
return false;
if (!m_wndSplitter2.CreateView(1,0 ,RUNTIME_CLASS(CMyFormView), CSize(0, 0), pContext))
......
In the CFormView class, I have member variable called iSwitch to keep track of which CFormView object I am dealing with. I need to initialize this variable appropriately during the creation of the CFormView objects. However, how can I initialize this variable during the construction of the view object in mainframe class as shown above?
You might say that I should create another class derived from CMyFormView and no more functionality to it. But I want to avoid creating another class if possible. Any suggestions? Thanks
m m
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
|