Stack overflow exception with CWinFormsDialog in MFC app

G

Guest

Hi,
I've discovered a stack-overflow crash scenario when using CWinformsDialog
to show a managed UserControl as a dialog in MFC8.

Basically all you have to do is press ESCape whilst the CWinFormsDialog is
in the process of being shown. A stack overflow occurs and the stack trace
shows that the MFC internal function "_AfxNextControl" is getting called
continually.

I've been able to easily recreate this behaviour in the "MFC04" sample
..Net/MFC application from MSDN. Run that app in the debugger, click New and
choose "Dialogs", press and hold the ESCape key and now click on the "Open"
button on the third row. The crash should occur now.

Why is this, and is there a solution?

Cheers,
Aled.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top