MFC - Passing data between dialogs in tab control

  • Thread starter Thread starter Melinda_123
  • Start date Start date
M

Melinda_123

Guest
Hi,

Question: how to pass data between two dialogs (which are in Tab Control)...
For example if we have ListBox1 in Dialog1 and we want to add string to ListBox1 from Dialog2 how to do that?
I try to include Dialog1 header file in Dialog2 and add object ( Dialog1 object_Dialog1 ; in to Dialog2,
and then in handler for some button in Dialog2, I wrote:
object_Dialog1.m_ListBox1.AddString(_T("s")); //m_ListBox1 is control variable for ListBox1 in Dialog1

but that cause ASSERT in afxwin2.inl :

_AFXWIN_INLINE int CListBox::AddString(LPCTSTR lpszItem)
{ ASSERT(::IsWindow(m_hWnd)); return (int)::SendMessage(m_hWnd, LB_ADDSTRING, 0, (LPARAM)lpszItem); }


Does anybody knows how to pass data between two dialogs in Tab Control?
Simple sample code would be nice...


Best Regards

Continue reading...
 
Back
Top