CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2008
    Location
    India
    Posts
    780

    [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.
    IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    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.
    Victor Nijegorodov

  3. #3
    Join Date
    Jan 2008
    Location
    India
    Posts
    780

    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.
    IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    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!
    Victor Nijegorodov

  5. #5
    Join Date
    Jan 2008
    Location
    India
    Posts
    780

    Re: How can check which FormView is currectly visible?

    thanks its done..
    IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured