Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Ask a problem,about inheritance :)

Ask a problem,about inheritance :)

Scheduled Pinned Locked Moved C / C++ / MFC
helpdebuggingoop
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rxgmoral
    wrote on last edited by
    #1

    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:)

    E 1 Reply Last reply
    0
    • R rxgmoral

      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:)

      E Offline
      E Offline
      earl
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups