Start CWinApp based app from a different DLL

Günther Humer 1 Reputation point
2022-11-14T08:36:28.517+00:00

Hi,
I am having a MFC-based UI app, that I want to initialize and run from a seperate dll, specifically from a Catch2 TEST_CASE.
I tried to export it and also exported theApp, linking statically, dynamically, calling AfxWinInit and wasted many hours with no success.
Errors ranging from pThread is nullptr to m_pszappnam is nullptr and at the end of the day I couldn't even compile it because there were many undefined or double defined references.

What is the correct way to perform:
InitApplication()
InitInstance()
RunInstancer()
from a different dll?

Thanks in advance

C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,780 questions
{count} votes

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.