Friday, 16 August 2013

Cannot access a child window's controls ( Created with CDialog::Create )

Cannot access a child window's controls ( Created with CDialog::Create )

I've been having some difficulties to understand and maybe you guys can help.
I have a project that uses CDialog and I've been trying to create a child
window that retrieves some info from the main window ( the main/child
windows have they're own classes), edits the content and sends the edited
info back to the main window.
When I tried using CDialog::Create(), I wasn't able to use ANY of the
controls on the child window. ( Example: Buttons are not responsive )
When I created the child window with DoModal() it backfired.. Buttons were
responsive, and I had access to the child window's class functions, but
when I tried to get the info from the main window class I was struck down
with an appcrash.
I have tried passing the CWnd manually but it still crashed.. Any ideas on
how can I create the child window while still having access to the main
app's variables ?

No comments:

Post a Comment