Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TabCtrl's TC_ITEM

Posted on 1998-03-28
1
Medium Priority
?
834 Views
Last Modified: 2013-11-20
I insert a CTreeCtrl into a CTabCtrl using the InsertItem() function:

  TC_ITEM TCI;
  TCI.mask = TCIF_PARAM;
  TCI.lParam = (LPARAM)pTreeCtrl;
  VERIFY(m_TabCtrl.InsertItem(0, &TCI) != -1);

I can get a pointer to the treectrl by doing:

  TC_ITEM TCI;
  TCI.mask = TCIF_PARAM;
  m_TabCtrl.GetItem(nTab, &TCI);
  CTreeCtrl * pWnd = (CTreeCtrl *)TCI.lParam;

But i want something like this,  :

  CTreeCtrl &Tree = GetTreefromTabCtrl();

How shall i go about modifying the above code?
0
Comment
Question by:leowlf
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 7

Accepted Solution

by:
galkin earned 150 total points
ID: 1317313
If you assign to all tab control items the pointer to tree control
1.Add variable m_tree of type CTreeCtrl to the class GetTreefromTabCtrl is member of
2.Add code for the function
CTreeCtrl& CYuorClass::GetTreefromTabCtrl()
{
ASSERT(m_TabCtrl.GetItemCount() > 0);

 TC_ITEM TCI;
  TCI.mask = TCIF_PARAM;
  m_TabCtrl.GetItem(0, &TCI);
  CTreeCtrl * pWnd = (CTreeCtrl *)TCI.lParam;
ASSERT_KINDOF(CTreeCtrl, pWnd);
CopyMemory(&m_tree, pWnd, sizeof(CTreeCtrl));
return m_tree;
}
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question