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
Solved

TabCtrl's TC_ITEM

Posted on 1998-03-28
1
821 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
1 Comment
 
LVL 7

Accepted Solution

by:
galkin earned 50 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Error on moodle after upgrade 3 140
Creating Labels and Frequency list style reports in SAS code 9 105
maxBlock challenge 30 142
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 102
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

790 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