Trying to include an MFC dialog from a library in an MFC Application but application crashes.

AlexS13 41 Reputation points
2021-12-15T12:00:56.13+00:00

Hello. I'm trying to include a dialog class from an MFC library to an MFC application. When I include them like this:

#include "CTestDlg.h"  
#include "CTestDlg.cpp"  

it's working.
When I include them from properties :

  • C/C++ Additional Include Directories : "Path"
  • Linker/General/Additional Library Directories) : ".obj path"
  • Linker/Input/AdditionalDependencies : CTestDlg.obj

MFC Application(is built from a wizard API, it's not default MFC App. If I create a default MFC app it's working) thrown an exception.

157814-exception-thrown.jpg

Any idea what could be causing the problem? Thanks.

Developer technologies | C++
{count} votes

1 answer

Sort by: Most helpful
  1. Flaviu_ 1,031 Reputation points
    2021-12-15T13:05:12.507+00:00

    Have you did a debugging in your code ? When exactly take happen that error ?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.