error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

hi all

i am Suffering with error C4430: missing type specifier - int assumed. Note: C++ does not support default-int in my Following Code at Line "operator = ( CInPlaceCombo) {}"

When i am using the Same Code in VC++ 6.0 it working Fine but when i have converted it into VC 2008 it raise Above error.

class CInPlaceCombo : public CComboBox
// Implementation
      // Returns the instance of the class
      static CInPlaceCombo* GetInstance();

      // Deletes the instance of the class
      static void DeleteInstance();

      // Creates the Windows combo control and attaches it to the object, if needed and shows the combo ctrl
      BOOL ShowComboCtrl(DWORD dwStyle, const CRect& rCellRect, CWnd* pParentWnd, UINT uiResourceID,
                                 int iRowIndex, int iColumnIndex, CStringList* pDropDownList, CString strCurSelecetion = "", int iCurSel = -1);

// Overrides
      // ClassWizard generated virtual function overrides
      virtual BOOL PreTranslateMessage(MSG* pMsg);


      // Generated message map functions
      afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
      afx_msg void OnKillFocus(CWnd* pNewWnd);
      afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
      afx_msg void OnCloseup();


// Implementation
      // Constructor

      // Hide the copy constructor and operator =
      CInPlaceCombo (CInPlaceCombo&) {}

      operator = ( CInPlaceCombo) {}

      // Destructor
      virtual ~CInPlaceCombo();

// Attributes

      // Index of the item in the list control
      int m_iRowIndex;

      // Index of the subitem in the list control
      int m_iColumnIndex;

      // To indicate whether ESC key was pressed
      BOOL m_bESC;
      // Singleton instance
      static CInPlaceCombo* m_pInPlaceCombo;

      // Previous selected string value in the combo control
      CString m_strWindowText;

      // List of items to be shown in the drop down
      CStringList m_DropDownList;

Please tell me how to handle it

Who is Participating?
ZoppoConnect With a Mentor Commented:
Hi Ruhela,

I guess the problem is that the operator doesn't return anything.

Try implement the operator like this:

> CInPlaceCombo& operator = ( const CInPlaceCombo& ) { return *this; }

Hope that helps,

VS2008 is more strict for type specifier then VS 6.0

Like earlier if you did not provide the data type for say for(i=0;condition;++i), then i is assume as int without any error. But for VS2008 it is an error for not to specify the data type as it does not assume it like earlier VS 6.0. That make it more strict in terms of type specifying. So the error that you got is just a function return type not specified, as the operator = ( CInPlaceCombo) {} is implicitly assume earlier of same to whom it is equated. But for VS2008 , you need to specify it and hence the error. Like Zoppo explained above, if you specify the return type explicitly to say what the operator = will return (or more correctly will assigned to) then the problem of not specifying the data type will be gone and it will continue work happily.
Jeez. Experts exchange does not like google chrome. It keeps messing up my posts.  

Please disregard that.
RuhelaAuthor Commented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.