Ask a problem,about inheritance :)
-
Ask a problem,about inheritance :) ****************static DLL***************** <<<<<<<<>>>>>>>>>> #pragma once class AFX_NOVTABLE CmView :public CView { public: __declspec(dllexport) CmView(); }; <<<<<<<<>>>>>>> #include "stdafx.h" #include "CmView.h" CmView::CmView() { } ******************static EXE****************** <<<<<<<>>>>>>>> #pragma once #include "CmView.h" #pragma comment(lib,"dll.lib") class EXEView : public CmView { ........... }; <<<<<<<<>>>>>>>> #include "stdafx.h" #include "EXEView.h" #ifdef _DEBUG #define new DEBUG_NEW #endif IMPLEMENT_DYNCREATE(CInfoEngineView, CmView) ....................... error: error C2039: 'classCmView' : is not a member of 'CmView' see declaration of 'CmView' error C2065: 'classCmView' : undeclared identifier why...... thank you:)
-
Ask a problem,about inheritance :) ****************static DLL***************** <<<<<<<<>>>>>>>>>> #pragma once class AFX_NOVTABLE CmView :public CView { public: __declspec(dllexport) CmView(); }; <<<<<<<<>>>>>>> #include "stdafx.h" #include "CmView.h" CmView::CmView() { } ******************static EXE****************** <<<<<<<>>>>>>>> #pragma once #include "CmView.h" #pragma comment(lib,"dll.lib") class EXEView : public CmView { ........... }; <<<<<<<<>>>>>>>> #include "stdafx.h" #include "EXEView.h" #ifdef _DEBUG #define new DEBUG_NEW #endif IMPLEMENT_DYNCREATE(CInfoEngineView, CmView) ....................... error: error C2039: 'classCmView' : is not a member of 'CmView' see declaration of 'CmView' error C2065: 'classCmView' : undeclared identifier why...... thank you:)
Why on earth are you declaring a C++ member function to be exported from a dll? If you just want a particular calling convention, say so, though perhaps member functions require __thiscall. However, unless it's just late and I'm being stupid, you can't call anything but a static member function from a dll because it's missing the this pointer. I assume that the CView object code is in dll.lib? Can you instantiate CmView? earl