Hi all,
I've created a 'framework' which creates tabs dynamically on the standard MFC CTabCtrl. It does this by loading DLL's, each of these DLLs is a dialog application. Each DLL application has relevant entities within an XML file, for example :
<DAFrameWork>
<Applications>
<Application name="Log" dll="Logger.dll" icon="log.bmp"/>
<Application name="Ping" dll="Ping.dll" icon="Ping.bmp"/>
</Applications>
</DAFrameWork>
Now to load the DLL's I do the following :
typedef CWnd* (*MYFUNC)(CWnd*);
MYFUNC pfunc;
HMODULE hMod = LoadLibrary( szDLLApp );
pfunc = (MYFUNC)GetProcAddress( hMod, _T("CallDlg") );
CWnd* pWnd = (pfunc)( GetParentFrame() );
Now, all of these DLL Applications have the CallDlg function which displays there dialog.
I attach these DLL applications to tabs in the following way :
TCITEM TabItem;
TabItem.cchTextMax = 10;
TabItem.pszText = szDLLAppName
TabItem.mask = TCIF_TEXT | TCIF_IMAGE;
TabItem.iImage = 0;
pTab->InsertItem( 0, &TabItem );
Now when I change tabs in the main application I just show the relevant dialog from the relevant DLL, this is called from the TCN_SELCHANGE event :
void CDAPlatformManagerView::OnSelchange(NMHDR* pNMHDR, LRESULT* pResult)
{
TCHAR szText[10];
TCITEM TabItem;
TabItem.mask = TCIF_TEXT;
TabItem.cchTextMax = 10;
TabItem.pszText = szText;
CTabCtrl* pTab = ( CTabCtrl* )GetDlgItem( IDC_APPTAB );
pTab->GetItem( pTab->GetCurSel(), &TabItem );
// Get the active view and hide it
CDAPlatformManagerDoc* pDoc = ( CDAPlatformManagerDoc* )GetDocument();
CString strViewname = pDoc->GetActiveView();
pDoc->CloseActiveView( strViewname );
// Show the new view
CString strActive = szText;
pDoc->ActivateView( strActive );
*pResult = 0;
}
Anyway, enough of the waffle, lets get to my question. I was wondering how these DLL applications which are stored on each tab could communicate to each other, say one of the DLL Apps needs information such as what is in an edit box in another of the DLL Apps. My problem is that these DLLs know nothing about each other, only the main application knows about them all.
Any help/advice is much appreciated.
Steve