Click here to Skip to main content
15,890,371 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Problem with const struct initialization in a class Pin
Erudite_Eric14-Sep-13 21:43
Erudite_Eric14-Sep-13 21:43 
AnswerRe: Problem with const struct initialization in a class Pin
Marco Bertschi15-Sep-13 10:35
protectorMarco Bertschi15-Sep-13 10:35 
AnswerRe: Problem with const struct initialization in a class Pin
Stefan_Lang17-Sep-13 0:34
Stefan_Lang17-Sep-13 0:34 
Questionlistview with tooltip Pin
JoneLe8612-Sep-13 18:16
JoneLe8612-Sep-13 18:16 
AnswerRe: listview with tooltip Pin
Richard MacCutchan13-Sep-13 3:35
mveRichard MacCutchan13-Sep-13 3:35 
Questiongetting pointer to document from OnGetTabToolTip in MDI tabbed app Pin
Member 258447412-Sep-13 6:41
Member 258447412-Sep-13 6:41 
SuggestionRe: getting pointer to document from OnGetTabToolTip in MDI tabbed app Pin
David Crow12-Sep-13 16:10
David Crow12-Sep-13 16:10 
GeneralRe: getting pointer to document from OnGetTabToolTip in MDI tabbed app Pin
Member 258447412-Sep-13 18:01
Member 258447412-Sep-13 18:01 
Thank you for the reply. Unfortunately, your link does not help solve the problem I described. Perhaps some code will clarify the issue. My ToolTip handler looks like this:

C++
LRESULT CMainFrame::OnGetTabToolTip(WPARAM wp, LPARAM lp)
{
	CMFCTabToolTipInfo* pInfo = (CMFCTabToolTipInfo*) lp;
	ASSERT (pInfo != NULL);
 
	if (pInfo)
	{
		ASSERT_VALID (pInfo->m_pTabWnd);
		if (!pInfo->m_pTabWnd->IsMDITab ())
		{
			return 0;
		}
 
		CWnd *pwnd = pInfo->m_pTabWnd->GetTabWnd(pInfo->m_nTabIndex);
                // CMyDoc *pDoc = get document from pwnd using pInfo->m_nTabIndex somehow ???
		pInfo->m_strText = pDoc->GetTabTipString();
	}
 
	return 0;
}


As you can see, a method for getting a pointer to the CDocument derived object CMyDoc from pwnd is needed. From what I have gathered so far, pwnd is a CWnd * to the tab control, and casting it to a (CMyDoc *) does NOT provide a valid pointer (I have tried).

Because the act of clicking on the tab activates the correct doc/view (which is the whole point of having a tabbed MDI), there should be some way of getting a pointer to it.. but I cannot see how this is done.
GeneralRe: getting pointer to document from OnGetTabToolTip in MDI tabbed app Pin
Member 258447412-Sep-13 18:04
Member 258447412-Sep-13 18:04 
AnswerRe: getting pointer to document from OnGetTabToolTip in MDI tabbed app Pin
jeron113-Sep-13 5:20
jeron113-Sep-13 5:20 
GeneralRe: getting pointer to document from OnGetTabToolTip in MDI tabbed app Pin
Member 258447413-Sep-13 7:39
Member 258447413-Sep-13 7:39 
QuestionResizing Controls and Texts Pin
Don Guy11-Sep-13 14:00
Don Guy11-Sep-13 14:00 
AnswerRe: Resizing Controls and Texts Pin
digitalspace.xjtu11-Sep-13 15:02
digitalspace.xjtu11-Sep-13 15:02 
AnswerRe: Resizing Controls and Texts Pin
SoMad11-Sep-13 17:16
professionalSoMad11-Sep-13 17:16 
QuestionWhat is doscreatemutexsem Pin
Carl Cioffi11-Sep-13 9:57
Carl Cioffi11-Sep-13 9:57 
QuestionRe: What is doscreatemutexsem Pin
David Crow11-Sep-13 10:33
David Crow11-Sep-13 10:33 
AnswerRe: What is doscreatemutexsem Pin
Carl Cioffi12-Sep-13 3:20
Carl Cioffi12-Sep-13 3:20 
GeneralRe: What is doscreatemutexsem Pin
David Crow12-Sep-13 3:36
David Crow12-Sep-13 3:36 
GeneralRe: What is doscreatemutexsem Pin
Carl Cioffi12-Sep-13 3:55
Carl Cioffi12-Sep-13 3:55 
QuestionRun MFC Program Without Dialog Showing Pin
Andraw11110-Sep-13 6:53
Andraw11110-Sep-13 6:53 
AnswerRe: Run MFC Program Without Dialog Showing Pin
Alan Balkany10-Sep-13 7:58
Alan Balkany10-Sep-13 7:58 
GeneralRe: Run MFC Program Without Dialog Showing Pin
Andraw11110-Sep-13 8:20
Andraw11110-Sep-13 8:20 
GeneralRe: Run MFC Program Without Dialog Showing Pin
Alan Balkany10-Sep-13 8:23
Alan Balkany10-Sep-13 8:23 
GeneralRe: Run MFC Program Without Dialog Showing Pin
Andraw11110-Sep-13 11:11
Andraw11110-Sep-13 11:11 
GeneralRe: Run MFC Program Without Dialog Showing Pin
Alan Balkany10-Sep-13 11:39
Alan Balkany10-Sep-13 11:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.