none
error C3646: 'CRuntimeClass' : unknown override specifier RRS feed

  • Question

  • I have been migrating the VC6 project into VS2010 compiler. Project compiles good with VC6 version but not VS2010. Here is the code snippet. Any help or guidance would be really appreciated.

    grdictrl.h

    class CTndGXDICtrl : public CGXEditControl
    {
    int DECLARE_CONTROL(CTndGXDICtrl);

    // Construction
    public:
    CTndGXDICtrl(CGXGridCore* pGrid, UINT nID, DWORD dwContext);
    DECLARE_DYNAMIC(CTndGXDICtrl)

    // Attributes
    public:
    CDataItemRef* GetDataItemRef(int nRow, int nCol);
    CDataEntity::deType GetTargetType(int nRow, int nCol);
    DWORD GetContext(int nRow, int nCol);
    void SetContext(int nRow, int nCol, CProject* pProj, DWORD dwContext);
    CProject* GetProject(int nRow, int nCol);
    void SetTargetType(int nRow, int nCol, CDataEntity::deType eType);
    void EmptyDataItemRef(int nRow, int nCol);
    void Empty(int nRow, int nCol);
    BOOL IsDataModified(int nRow, int nCol);
    void SetDataModified(int nRow, int nCol, BOOL b);
    // Operations
    public:
    //
    // Returns true if the edit control is in the state to find an array index
    //
    BOOL CTndGXDICtrl::CanFindArrayIndex();

    //
    // Update a local/param entry - a CLocal/CParam
    //
    BOOL UpdateLocalParamEntry(CDataEntity* pDE);


    //
    // right mouse menu for Find and Instant XRef
    //
    void LoadRightMouseMenu(CPoint point, BOOL bEnableLocal);

    BOOL ParseAndAssignDataItemRef(ROWCOL row, ROWCOL col, const CString& cs);
    BOOL ParseAndAssignDataItemRef(const CString& cs);

    // Overrides

    // CGXControl interface
    virtual BOOL OnValidate(ROWCOL row, ROWCOL col, const CString& s);
    virtual BOOL OnValidate();
    virtual BOOL OnLeftCell(ROWCOL nNewRow, ROWCOL nNewCol);
    virtual BOOL OnGridChar(UINT nChar, UINT nRepCnt, UINT nFlags);
    virtual BOOL LButtonDblClk(UINT nFlags, CPoint point);
    virtual BOOL ValidatePaste(const CString& sPaste);
    virtual BOOL SetControlText(ROWCOL nRow, ROWCOL nCol, const CString& str, UINT nFlags, const CGXStyle* pOldStyle);


    // ClassWizard generated virtual function overrides
    //{{AFX_VIRTUAL(CTndGXDICtrl)
    public:
    virtual BOOL PreTranslateMessage(MSG* pMsg);
    protected:
    virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
    //}}AFX_VIRTUAL

    // Implementation
    public:
    virtual ~CTndGXDICtrl();

    private:
    void GetAllOidsForXref(CDWordArray& arrOids);

    // Generated message map functions
    protected:
    //{{AFX_MSG(CTndGXDICtrl)
    afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT flags);
    afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
    afx_msg void OnRmouseFindGlobalDi();
    afx_msg void OnRmouseFindLocalDi();
    afx_msg void OnRmouseInstantXref();
    //}}AFX_MSG
    LRESULT OnPostedReturnDataItem(WPARAM, LPARAM);

    DECLARE_MESSAGE_MAP()

    BOOL m_bInOnChange;
    BOOL m_bAutoComplete;
    BOOL m_bIgnoreKillFocusForFind;

    BOOL DoAutoComplete();
    CDIControlInfo* GetDIC(int nRow, int nCol);

    };

    gridctrl.cpp

    #include "stdafx.h"

    #include "dbg.h"
    #include "dbifexp.h"
    #include "gridctrl.h"
    #include "launch.h"
    #include "tagparse.h"
    #include "tndmsgs.h"
    #include "resource.h"



    #ifdef _DEBUG
    #define new DEBUG_NEW
    #endif
    #undef THIS_FILE
    static char THIS_FILE[] = __FILE__;

    #import "..\bin\pb.tlb" named_guids //raw_interfaces_only


    IMPLEMENT_CONTROL(CTndGXDICtrl, CGXEditControl)
    IMPLEMENT_DYNAMIC(CTndGXDICtrl, CGXEditControl)


    #define GRID_WARNING(IDP) \
    { \
    CString cs; \
    VERIFY(cs.LoadString(IDP)); \
    Grid()->SetWarningText(cs); \
    }

    /////////////////////////////////////////////////////////////////////////////
    // CTndGXDICtrl

    CTndGXDICtrl::CTndGXDICtrl(CGXGridCore* pGrid, UINT nID, DWORD dwContext)
    : CGXEditControl(pGrid, nID)
    {
    m_bInOnChange = FALSE;
    m_bAutoComplete = TRUE;
    m_bIgnoreKillFocusForFind = FALSE;
    }

    CTndGXDICtrl::~CTndGXDICtrl()
    {
    }


    BEGIN_MESSAGE_MAP(CTndGXDICtrl, CGXEditControl)
    //{{AFX_MSG_MAP(CTndGXDICtrl)
    ON_WM_CHAR()
    ON_WM_LBUTTONDBLCLK()
    ON_COMMAND(ID_RMOUSE_FIND_GLOBAL_DI, OnRmouseFindGlobalDi)
    ON_COMMAND(ID_RMOUSE_FIND_LOCAL_DI, OnRmouseFindLocalDi)
    ON_COMMAND(ID_RMOUSE_INSTANT_XREF, OnRmouseInstantXref)
    //}}AFX_MSG_MAP
    ON_MESSAGE(TND_RETURNED_DATAITEM, OnPostedReturnDataItem)
    END_MESSAGE_MAP()

    /////////////////////////////////////////////////////////////////////////////
    // CTndGXDICtrl message handlers
    void CTndGXDICtrl::EmptyDataItemRef(int nRow, int nCol)
    {
    CDIControlInfo* pDIC = GetDIC(nRow, nCol);
    if (NULL != pDIC)
    {
    CDataItemRef* pDIR = NULL;
    pDIR = &(pDIC ->m_cDataItemRef);
    pDIR ->Empty();
    }
    }

    void CTndGXDICtrl::Empty(int nRow, int nCol)
    {
    CDIControlInfo* pDIC = GetDIC(nRow, nCol);
    if (NULL != pDIC)
    {
    CDataItemRef* pDIR = NULL;
    pDIR = &(pDIC ->m_cDataItemRef);
    pDIR ->Empty();
    SetTargetType(nRow, nCol, CDataEntity::deNull);
    }
    }
    CDIControlInfo* CTndGXDICtrl::GetDIC(int nRow, int nCol)
    {
    if ((nRow == -1) || (nCol == -1))
    return NULL;
    CDIControlInfo* pDIC = NULL;
    CGXGridWnd* pGrid = (CGXGridWnd*) GridWnd();
    if (NULL != pGrid)
    {
    CGXStyle s;
    pGrid ->GetStyleRowCol(nRow, nCol, s);
    pDIC = (CDIControlInfo*) s.GetItemDataPtr();
    }
    return pDIC;
    }

    CDataItemRef* CTndGXDICtrl::GetDataItemRef(int nRow, int nCol)
    {
    CDataItemRef* pDIR = NULL;
    CDIControlInfo* pDIC = GetDIC(nRow, nCol);
    if (NULL != pDIC)
    {
    pDIR = &(pDIC ->m_cDataItemRef);
    }
    return pDIR;
    }

    CDataEntity::deType CTndGXDICtrl::GetTargetType(int nRow, int nCol)
    {
    CDataEntity::deType eType = CDataEntity::deNull;
    CDIControlInfo* pDIC = GetDIC(nRow, nCol);
    if (NULL != pDIC)
    {
    eType = pDIC ->m_eTargetType;
    }
    return eType;
    }

    DWORD CTndGXDICtrl::GetContext(int nRow, int nCol)
    {
    DWORD dw = 0;
    CDIControlInfo* pDIC = GetDIC(nRow, nCol);
    if (NULL != pDIC)
    {
    dw = pDIC ->m_dwContext;
    }
    return dw;
    }


    CProject* CTndGXDICtrl::GetProject(int nRow, int nCol)
    {
    CProject* p = NULL;
    CDIControlInfo* pDIC = GetDIC(nRow, nCol);
    if (NULL != pDIC)
    {
    p = pDIC ->m_pProject;
    }
    return p;
    }

    void CTndGXDICtrl::SetContext(int nRow, int nCol, CProject* pProj, DWORD dwContext)
    {
    CDIControlInfo* pDIC = GetDIC(nRow, nCol);
    if (NULL != pDIC)
    {
    pDIC ->m_dwContext = dwContext;
    }
    }


    void CTndGXDICtrl::SetTargetType(int nRow, int nCol, CDataEntity::deType eType)
    {
    CDIControlInfo* pDIC = GetDIC(nRow, nCol);
    if (NULL != pDIC)
    {
    pDIC ->m_eTargetType = eType;
    }
    }

    Here is the complete error list:

    c:\2010\fv32\gridctrl.cpp(41): error C3646: 'CRuntimeClass' : unknown override specifier
    c:\2010\fv32\gridctrl.cpp(41): error C2143: syntax error : missing ';' before '*'
    c:\2010\fv32\gridctrl.cpp(41): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
    c:\2010\fv32\gridctrl.cpp(41): error C2509: '_GetBaseClass' : member function not declared in 'CTndGXDICtrl'
              c:\2010\fv32\gridctrl.h(58) : see declaration of 'CTndGXDICtrl'

    Error C3646 shows up with the following line:

    IMPLEMENT_DYNAMIC(CTndGXDICtrl, CGXEditControl)

    I may be missing something here, any guidance will be useful.

    Regards.


    • Edited by WinDvlpr Monday, May 7, 2018 3:57 PM
    • Moved by Baron Bi Wednesday, June 6, 2018 8:21 AM Third-party issue
    Monday, May 7, 2018 3:56 PM

All replies

  • The DECLARE_CONTROL and IMPLEMENT_CONTROL macros are no longer used.  You'll have to look in the VC6 MFC source code to figure out what they were doing.  You may be able to delete them.  If this is based on RogueWave software, it looks like you can use GRID_DECLARE_CONTROL instead.

    Tim Roberts, Driver MVP Providenza & Boekelheide, Inc.

    • Proposed as answer by Tim Roberts Tuesday, May 8, 2018 5:17 AM
    Monday, May 7, 2018 6:08 PM
  • Hello Tim,

    Yes, these are based on RogueWave Software, let me try to investigate much further on GRID_DECLARE_CONTROL. Thanks.

    Monday, May 7, 2018 6:53 PM
  • Hello Tim,

    I did commented out the DECLARE_CONTROL and IMPLEMENT_CONTROL to get the compilation done. Now it does compile without any errors, but linking fails. Lot of unresolved external symbol errors like, LNK2001, LNK2019. Any suggestions? Thanks.

    Wednesday, May 9, 2018 3:32 PM
  • You'll have to tell us which entry points were not found.  Are you, by chance, linking with a very old 3rd-party library?  That could be the issue.

    Tim Roberts, Driver MVP Providenza & Boekelheide, Inc.

    Friday, May 11, 2018 10:38 PM
  • These are the libraries trying to link to: tndsrgasud.lib / tndsrgasu.lib (Stingray libs)

    Here are the few linker errors:

    DOffset.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: static struct AFX_MSGMAP const * __stdcall CGXGridWnd::GetThisMessageMap(void)" (__imp_?GetThisMessageMap@CGXGridWnd@@KGPBUAFX_MSGMAP@@XZ)
    ControlDialog.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: static struct AFX_MSGMAP const * __stdcall CGXGridWnd::GetThisMessageMap(void)" (__imp_?GetThisMessageMap@CGXGridWnd@@KGPBUAFX_MSGMAP@@XZ) referenced in function "protected: static struct AFX_MSGMAP const * __stdcall CCtrlGridWnd::GetThisMessageMap(void)" (?GetThisMessageMap@CCtrlGridWnd@@KGPBUAFX_MSGMAP@@XZ)
    DBeginDialog.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: static struct AFX_MSGMAP const * __stdcall CGXGridWnd::GetThisMessageMap(void)" (__imp_?GetThisMessageMap@CGXGridWnd@@KGPBUAFX_MSGMAP@@XZ)
    DBooleanExpression.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: static struct AFX_MSGMAP const * __stdcall CGXGridWnd::GetThisMessageMap(void)" (__imp_?GetThisMessageMap@CGXGridWnd@@KGPBUAFX_MSGMAP@@XZ)
    DCall.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) protected: static struct AFX_MSGMAP const * __stdcall CGXGridWnd::GetThisMessageMap(void)" (__imp_?GetThisMessageMap@CGXGridWnd@@KGPBUAFX_MSGMAP@@XZ)
    DOffset.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CGXGridCore::SetStyleRange(class CGXRange const &,class CGXStyle const &,enum GXModifyType,int,unsigned int)" (?SetStyleRange@CGXGridCore@@UAEHABVCGXRange@@ABVCGXStyle@@W4GXModifyType@@HI@Z)
    ControlDialog.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall CGXGridCore::SetStyleRange(class CGXRange const &,class CGXStyle const &,enum GXModifyType,int,unsigned int)" (?SetStyleRange@CGXGridCore@@UAEHABVCGXRange@@ABVCGXStyle@@W4GXModifyType@@HI@Z)

    Wednesday, May 16, 2018 3:02 PM
  • Hi,

    thanks for posting here.

    >>These are the libraries trying to link to: tndsrgasud.lib / tndsrgasu.lib (Stingray libs)

    There are multiple possible reasons for these two link errors, you could refer to these documents below.

    https://msdn.microsoft.com/en-us/library/f6xx1b1z.aspx

    https://msdn.microsoft.com/en-us/library/799kze2z.aspx

    Besides, this forum is about c++ development with Microsoft products. For your case which is more related to third-party libraries, please post on this forum below.

    https://www.roguewave.com/help-support/technical-support

    Your understanding and cooperation will be grateful.

    Best Regards,

    Baron Bi


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, May 17, 2018 6:54 AM