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 General Discussion » syntax error : identifier ’pMalloc’ error Collapse All
Subject Author Date
Douglas Hoppes Apr 22, 2009 - 7:41 AM

In our core library, I am creating a descendant class of CExtGridCellCheckBox and have placed the

IMPLEMENT_SERIAL(CExtGridCellCheckBoxTest, CExtGridCellCheckBox, VERSIONABLE_SCHEMA|1 );

in my cpp file (before my debug statement). The core library builds/links fine. However, when I try to use my core library with my application, I always get the compile error:

"syntax error : identifier ’pMalloc’" in my application (The core library builds fine.... no errors). This is caused by the

IMPLEMENT_ExtGridCell_Clone( CExtGridCellCheckBoxEye, CExtGridCellCheckBox );

How can I get rid of this error?

Note: in my .h file, I have:
class MBFCORE_EXT_CLASS CExtGridCellCheckBoxEye : public CExtGridCellCheckBox
{
public:
    DECLARE_SERIAL(CExtGridCellCheckBoxTest);
    IMPLEMENT_ExtGridCell_Clone(CExtGridCellCheckBoxTest, CExtGridCellCheckBox);
...

Doug

Technical Support Apr 22, 2009 - 11:36 AM

The IMalloc is a very standard COM interface which is struct type in terms of C++ with only public and virtual methods inside. The CExtAlloc class in Prof-UIS is derived from the IMalloc structure and implements this interface. So, if the IMalloc type declaration is not available when compiling Prof-UIS library and your Prof-UIS based projects, then you should not be able to compile them. But the error described in your message looks like some specific misprint somewhere near the IMPLEMENT_ExtGridCell_Clone line of code and there is not enough information in your message to came to any conclusions about what is really happen. The IMPLEMENT_ExtGridCell_Clone macro function is declared as following:

#define IMPLEMENT_ExtGridCell_Clone( __derived__ , __base__ ) \
            virtual CExtGridCell * Clone( \
                        IMalloc * pMalloc = NULL \
                        ) const \
            { \
                        ASSERT_VALID( this ); \
                        if( pMalloc == NULL ) \
                                    return __base__ :: Clone( pMalloc ); \
                        CExtGridCell * pOther = \
                                                new ( pMalloc, false ) __derived__ \
                                                (           (           const_cast \
                                                                        < __derived__ * > \
                                                                        ( this ) \
                                                            ) \
                                                            -> DataProviderGet() \
                                                ); \
                        ASSERT( pOther != NULL ); \
                        if( pOther != NULL ) \
                        { \
                                    ASSERT_VALID( pOther ); \
                                    pOther->Assign( *this ); \
                                    ASSERT( pOther->DataProviderGet() == DataProviderGet() ); \
                        } \
                        return pOther; \
            }

As you can see there are no any other specific macros inside it which can be occasionally redefined in scope of your project. It contains only enough simple lines of code and one invocation of the new operator with custom parameters. This operator is provided by the CExtGridCell class and it’s automatically available for all the grid cell classes.
Could you please send us a smallest possible test project which has the same compilation error?