I am trying to make a user DLL which includes the MFC derived class CButton (or really any MFC class). If I leave the CButton class out the dll runs great. As soon as I include the CButton member the executable causes a trap as soon as DoModal is called. Any ideas?


#define DLLAPI _declspec(dllexport)

class MyClass : CDialog
{
DECLARE_DYNAMIC(MyClass)
public:
DLLAPI MyClass();
DLLAPI DoModal();

CButton aBtn;
}