Discussion:
MDI app: passing data from Main frame to child frame
(too old to reply)
p***@yahoo.com
2013-02-08 12:31:17 UTC
Permalink
Hi all, I am creating a MDI app using MS VC++ and I want the children to share some common data. How can I pass these from the main frame (mainfrm.cpp) to the child windows (childfrm.cpp)?
TIA
Phil
ScottMcP [MVP]
2013-02-08 13:58:28 UTC
Permalink
Post by p***@yahoo.com
Hi all, I am creating a MDI app using MS VC++ and I want the children to share some common data. How can I pass these from the main frame (mainfrm.cpp) to the child windows (childfrm.cpp)?
TIA
Phil
You can iterate through all document templates, all documents and all views using GetFirstDocumentTemplatePosition, GetFirstDocPosition, GetFirstViewPosition and related functions.
p***@yahoo.com
2013-02-08 14:42:34 UTC
Permalink
Post by ScottMcP [MVP]
Post by p***@yahoo.com
Hi all, I am creating a MDI app using MS VC++ and I want the children to share some common data. How can I pass these from the main frame (mainfrm.cpp) to the child windows (childfrm.cpp)?
TIA
Phil
You can iterate through all document templates, all documents and all views using GetFirstDocumentTemplatePosition, GetFirstDocPosition, GetFirstViewPosition and related functions.
thanks!
Miles Davies
2013-08-19 14:30:39 UTC
Permalink
Post by p***@yahoo.com
Hi all, I am creating a MDI app using MS VC++ and I want the children to share some common data. How can I pass these from the main frame (mainfrm.cpp) to the child windows (childfrm.cpp)?
TIA
Phil
in your children....

auto pMain = DYNAMIC_DOWNCAST(CMainFrame, AfxGetMainWnd()) ;
ENSURE(pMain);
auto data& = pMain-> call some function to access data;

Loading...