If I switch my project from using MFC in a shared DLL to use MFC in a static library, the following code won't compile:
class Test : public CObject
{
public:
//DECLARE_DYNCREATE(Test); // If I uncomment this line, it works
};
class Test2 : public Test
{
public:
DECLARE_DYNCREATE(Test2);
};
IMPLEMENT_DYNCREATE(Test2, Test); // <-- error C2039: 'classTest' : is not a member of 'Test'
Though, if I uncomment DECLARE_DYNCREATE(Test), it works. I can't find anything in the docs saying the base class must use DECLARE_DYNCREATE, or that there is a difference between linking statically or shared.
The problem is I have some thirdparty code which doesn't use the DYNCREATE macros. Does anyone know why the requirements differs when linking statically, and if there is a way to get around this without declaring the base class with DECLARE_DYNCREATE?
Thanks.