Click here to Skip to main content
15,895,084 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
AnswerRe: Passing data between tabs in a tab control Pin
Hamid_RT14-Jul-06 8:14
Hamid_RT14-Jul-06 8:14 
GeneralRe: Passing data between tabs in a tab control Pin
cppcook14-Jul-06 8:26
cppcook14-Jul-06 8:26 
GeneralRe: Passing data between tabs in a tab control Pin
Hamid_RT14-Jul-06 19:00
Hamid_RT14-Jul-06 19:00 
QuestionHelp passing variabiles between dialogs Pin
User 34160314-Jul-06 7:18
User 34160314-Jul-06 7:18 
AnswerRe: Help passing variabiles between dialogs Pin
led mike14-Jul-06 7:25
led mike14-Jul-06 7:25 
AnswerRe: Help passing variabiles between dialogs Pin
Jun Du14-Jul-06 7:27
Jun Du14-Jul-06 7:27 
AnswerRe: Help passing variabiles between dialogs Pin
David Crow14-Jul-06 7:28
David Crow14-Jul-06 7:28 
AnswerRe: Help passing variabiles between dialogs Pin
User 34160314-Jul-06 7:40
User 34160314-Jul-06 7:40 
QuestionSubclassing Pin
Fernando A. Gomez F.14-Jul-06 7:13
Fernando A. Gomez F.14-Jul-06 7:13 
QuestionRe: Subclassing Pin
David Crow14-Jul-06 7:21
David Crow14-Jul-06 7:21 
AnswerRe: Subclassing Pin
valikac14-Jul-06 7:24
valikac14-Jul-06 7:24 
AnswerRe: Subclassing Pin
led mike14-Jul-06 7:29
led mike14-Jul-06 7:29 
GeneralRe: Subclassing Pin
Fernando A. Gomez F.14-Jul-06 10:22
Fernando A. Gomez F.14-Jul-06 10:22 
AnswerRe: Subclassing Pin
PJ Arends14-Jul-06 7:34
professionalPJ Arends14-Jul-06 7:34 

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.