[RESOLVED] How can check which FormView is currectly visible?
Hi all,
i m working on SDI type splitter application.
i have split my application in one row and two column ,for first column im using CTreeView derived class and for second column i m using CFormView derived class.
in second column i m replace diffrent-2 formview according to need.
its working fine.but at certain point i need to chk which formview is currently visible in second column.
please tell me what function and api use for this.
thanks in advance.
Re: How can check which FormView is currectly visible?
If these two form views are of different classes (CFormView1 and CFormView2) then you could use CObject::IsKindOf to check the class.
If two instances of the same class (CFormView1) are used - add some member variable to the CFormView1 class (say, int Inst) and set it to 1 for the first instance and to two - for the second one.
Re: How can check which FormView is currectly visible?
i m using this.
Code:
Check_Current_View(CFormView * pViewClass)
{
BOOL flag=FALSE;
if ((GetPane(row,col)->IsKindOf(pViewClass))==TRUE)
{
flag=TRUE;
}
return flag;
}
when call this function from toolbar of menu item function than its problem generate.
Re: How can check which FormView is currectly visible?
1. You must not to compare ant BOOL variable wit TRUE! the correct way to test BOOL is
Code:
BOOL bValue = ...;
...
if(bValue)
{
// TRUE
}
.....
if(!bValue)
{
// FALSE
}
2. I wrote you many times that you must read the documentation about using any API and any MFC method in MSDN! PLease, do it! :(
Re: How can check which FormView is currectly visible?