Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Compiler error when subclassing, Collapse All
Subject Author Date
Dongsik Chae Aug 27, 2008 - 2:50 AM

Dear,


I reffered the article "Prof-UIS Grid Brief Overview".


And subclassed ’CExtGridCellButton’ as follows. But the compiler issues the errors;


error C2061: syntax error : identifier ’pMalloc’


      at IMPLEMENT_ExtGridCell_Clone( CExtGridCellButtonNoti, CExtGridCellButton );


error C2665: ’CExtGridCell::operator new’ : none of the 2 overloads could convert all the argument types

could be ’void *CExtGridCell::operator new(size_t,IMalloc *,bool)’


   


// class declaration


class CExtGridCellButtonNoti : public CExtGridCellButton {

public:

      DECLARE_DYNCREATE( CExtGridCellButtonNoti );

      IMPLEMENT_ExtGridCell_Clone( CExtGridCellButtonNoti, CExtGridCellButton );

      CExtGridCellButtonNoti (

            CExtGridDataProvider * pDataProvider = NULL

            )

            : CExtGridCellButton( pDataProvider )

      {

      }

      virtual ~CExtGridCellButtonNoti ()

      {

      }

#ifdef _DEBUG

      virtual void AssertValid() const

      {

            CExtGridCell::AssertValid();

      }

      virtual void Dump( CDumpContext & dc ) const

      {

            CExtGridCell::Dump( dc );

      }

#endif // _DEBUG

...


 

Technical Support Aug 27, 2008 - 11:42 AM

You should insert the IMPLEMENT_ExtGridCell_Clone( CExtGridCellButtonNoti, CExtGridCellButton ); line of code before definition of the debug version of MFC’s new operator.


Dongsik Chae Aug 27, 2008 - 4:14 AM

Solved.


The reason is...


#ifdef _DEBUG

#define new DEBUG_NEW

#endif


ˆ_ˆ;;;