简体   繁体   中英

Child's DoDataExchange is never called in child dialog ? - MFC

I simply want to open a child dialog and have it print a result from the parent dialog in one of the child's static text controls. Using breakpoints I noticed that both DoDataExchange and my overloaded OnInitDialog are never called in the child so the static text control crashes any time i try to print something to it. The child dialog does display itself fine otherwise.

What could be the problem ?

//in parent.cpp
CResultsDlg childResultsDlg = this;
childResultsDlg.DoModal(15.7); //overloaded to pass value to a child member var

more information from my previous post Child Dialog - SetWindowTextA or SendMessageA crashes program - MFC

All of the basics of MFC are covered in the SCRIBBLE tutorial.

http://msdn.microsoft.com/en-us/library/f35t8fts(v=vs.90).aspx

An example of passing data into a dialog and displaying that data in dialog controls is provided in the tutorial with the CPenWidthsDlg.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM