Click here to Skip to main content
15,916,189 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: dynamic arrays in classes - are they correct? Pin
cje14-Jul-06 9:05
cje14-Jul-06 9:05 
AnswerRe: dynamic arrays in classes - are they correct? Pin
Zac Howland14-Jul-06 9:29
Zac Howland14-Jul-06 9:29 
AnswerRe: dynamic arrays in classes - are they correct? Pin
Hamid_RT15-Jul-06 5:03
Hamid_RT15-Jul-06 5:03 
QuestionVS2005 Team Pin
Alex_Y14-Jul-06 8:12
Alex_Y14-Jul-06 8:12 
AnswerRe: VS2005 Team Pin
Jun Du14-Jul-06 8:22
Jun Du14-Jul-06 8:22 
GeneralRe: VS2005 Team Pin
Alex_Y14-Jul-06 8:43
Alex_Y14-Jul-06 8:43 
GeneralRe: VS2005 Team Pin
Jun Du14-Jul-06 9:23
Jun Du14-Jul-06 9:23 
GeneralRe: VS2005 Team Pin
Alex_Y14-Jul-06 9:36
Alex_Y14-Jul-06 9:36 
GeneralRe: VS2005 Team Pin
Jun Du14-Jul-06 9:49
Jun Du14-Jul-06 9:49 
GeneralRe: VS2005 Team Pin
Alex_Y14-Jul-06 11:25
Alex_Y14-Jul-06 11:25 
QuestionWhat's the best way to do this? Pin
Alex Cutovoi14-Jul-06 8:07
Alex Cutovoi14-Jul-06 8:07 
QuestionRe: What's the best way to do this? Pin
Jun Du14-Jul-06 8:27
Jun Du14-Jul-06 8:27 
AnswerRe: What's the best way to do this? Pin
Alex Cutovoi14-Jul-06 8:55
Alex Cutovoi14-Jul-06 8:55 
GeneralRe: What's the best way to do this? Pin
Jun Du14-Jul-06 9:47
Jun Du14-Jul-06 9:47 
QuestionDifference between debug and execution on open file Pin
hli114-Jul-06 7:52
hli114-Jul-06 7:52 
AnswerRe: Difference between debug and execution on open file Pin
eusto14-Jul-06 8:12
eusto14-Jul-06 8:12 
GeneralRe: Difference between debug and execution on open file Pin
hli114-Jul-06 8:35
hli114-Jul-06 8:35 
GeneralRe: Difference between debug and execution on open file Pin
PJ Arends14-Jul-06 8:42
professionalPJ Arends14-Jul-06 8:42 
GeneralRe: Difference between debug and execution on open file Pin
hli114-Jul-06 9:02
hli114-Jul-06 9:02 
GeneralRe: Difference between debug and execution on open file Pin
hli114-Jul-06 9:33
hli114-Jul-06 9:33 
GeneralRe: Difference between debug and execution on open file Pin
hli114-Jul-06 10:03
hli114-Jul-06 10:03 
QuestionPassing data between tabs in a tab control [modified] Pin
cppcook14-Jul-06 7:36
cppcook14-Jul-06 7:36 
Hi all,

I have a tab control in a dialog. There are 5 tabs in total, with each tab associated with a child dialog. I wanna exchange information between these tabs. I store and update all information in a global structure. When I switch between these tabs, I want to update data in these tabs. How can I do that? Currently I am using:
<br />
CMyTabCtrl::OnSelchange(NMHDR* pNMHDR, LRESULT* pResult)<br />
{<br />
	int nSel = GetCurSel();<br />
	if(m_Dialog[nSel]->m_hWnd)<br />
		m_Dialog[nSel]->ShowWindow(SW_HIDE); //hide window<br />
        ............<br />
	//hide all tabs and show the selected tab<br />
	for(int nCount=0; nCount < m_nPageCount; nCount++){<br />
		m_Dialog[nCount]->SetWindowPos(&wndTop, l_rectClient.left,l_rectClient.top,l_rectClient.Width(),l_rectClient.Height(),SWP_HIDEWINDOW);<br />
	}<br />
	m_Dialog[nSel]->SetWindowPos(&wndTop,l_rectClient.left,l_rectClient.top,l_rectClient.Width(),l_rectClient.Height(),SWP_SHOWWINDOW);<br />
	m_Dialog[nSel]->ShowWindow(SW_SHOW); //show selected tab<br />
	m_Dialog[nSel]->OnInitDialog(); //update information for each dialog<br />
}<br />

I placed all updating code in each child dialog's OnInitDialog() function. The problem is this function will be called twice so some controls like ListView have double items. How to fix this problem? Do I need to use SendMessage(), PostMessage()?
thanks,

Gavin
AnswerRe: Passing data between tabs in a tab control Pin
eusto14-Jul-06 8:09
eusto14-Jul-06 8:09 
GeneralRe: Passing data between tabs in a tab control Pin
cppcook14-Jul-06 8:23
cppcook14-Jul-06 8:23 
GeneralRe: Passing data between tabs in a tab control Pin
eusto14-Jul-06 8:48
eusto14-Jul-06 8:48 

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.