using MFC in a managed application, ASSERT in AfxGetResourceHandle

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
steps to reproduce the behaviour:
- create a managed C++ Windows Forms Application,
- in the designer view, drag a button on the form
- add the following code to the Click event for that button:
CFileDialog dlg(TRUE);
dlg.DoModal();
- #include <afxdlgs.h> in the Header of that from
- build and run the application (in debug mode)
- when you click the button the following assert in AfxGetResourceHandle
fails:
ASSERT(afxCurrentResourceHandle != NULL)

Note that in the project settings use MFC as shared library is turned on.

Thanks in advance


Arne
 
Back
Top