#pragma once #include "dbmain.h" //----- Note: we don't use __declspec(dllimport) here, because of the //----- "local vtable" problem with msvc. If you use __declspec(dllimport), //----- then, when a client dll does a new on the class, the object's //----- vtable pointer points to a vtable allocated in that client //----- dll. If the client dll then passes the object to another dll, //----- and the client dll is then unloaded, the vtable becomes invalid //----- and any virtual calls on the object will access invalid memory. //----- //----- By not using __declspec(dllimport), we guarantee that the //----- vtable is allocated in the server dll during the ctor and the //----- client dll does not overwrite the vtable pointer after calling //----- the ctor. And, since we expect the server dll to remain in //----- memory indefinitely, there is no problem with vtables unexpectedly //----- going away. class AecDrawingStreamRecord; class AecDbProxyAcGiEntity : public AcDbEntity { public: ACRX_DECLARE_MEMBERS(AecDbProxyAcGiEntity) ; AecDbProxyAcGiEntity(void); virtual ~AecDbProxyAcGiEntity(void); virtual Acad::ErrorStatus dwgOutFields (AcDbDwgFiler *pFiler) const ; virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler *pFiler) ; #if ARX<18 virtual Adesk::Boolean worldDraw (AcGiWorldDraw *mode) ; virtual void viewportDraw(AcGiViewportDraw * mode); #else virtual Adesk::Boolean subWorldDraw (AcGiWorldDraw *mode) ; virtual void subViewportDraw(AcGiViewportDraw * mode); #endif void setDrawingStreamRecord(AecDrawingStreamRecord* pRec); void setSubEntity(AcDbObjectId& id); void setTransform(AcGeMatrix3d& xform); void setRegenType(AcGiRegenType eType); private: AcGiWorldDraw* m_pUnknownWorldDraw; AcGiViewportDraw* m_pUnknownViewportDraw; AcDbObjectId m_idSubObj; AcGeMatrix3d m_xform; AcGiRegenType m_eType; };