News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Class Effect - classes in UASM

Started by LiaoMi, June 15, 2020, 08:59:43 PM

Previous topic - Next topic

LiaoMi

Hi,

is it possible to adapt the use of classes in UASM, I have not tried it yet  :icon_idea: In this thread - http://masm32.com/board/index.php?topic=7000.msg93944#msg93944, nidud has very attractive examples! In addition, I would like to check the conversion of classes in the file header converter. Therefore, the question is, in what format should the classes be stored, so that the UASM understands them.

class Effect
{
    friend class Bitmap;
    friend class Graphics;
   
public:

    Effect()
    {
        auxDataSize = 0;
        auxData = NULL;
        nativeEffect = NULL;
        useAuxData = FALSE;
    }
   
    virtual ~Effect()
    {
        // pvData is allocated by ApplyEffect. Return the pointer so that
        // it can be freed by the appropriate memory manager.
       
        DllExports::GdipFree(auxData);
       
        // Release the native Effect.
       
        GdipDeleteEffect(nativeEffect);
    }
   
    INT GetAuxDataSize() const
    {
        return auxDataSize;
    }
   
    VOID *GetAuxData() const
    {
        return auxData;
    }
   
    VOID UseAuxData(const BOOL useAuxDataFlag)
    {
        useAuxData = useAuxDataFlag;
    }

    Status GetParameterSize(UINT *size)
    {
        return GdipGetEffectParameterSize(nativeEffect, size);
    }
   
protected:
   
    Status SetParameters(const void *params, const UINT size)
    {
        return GdipSetEffectParameters(nativeEffect, params, size);
    }

    Status GetParameters(UINT *size, void *params)
    {
        return GdipGetEffectParameters(nativeEffect, size, params);
    }

    // protected data members.
   
    CGpEffect *nativeEffect;
    INT auxDataSize;
    VOID *auxData;
    BOOL useAuxData;
};





johnsa

UASM has a basic macro-derived OO/class implementation but it's nowhere near as C++ like as ASMC. I doubt you'd be able to work it like for like without a fair amount of re-work.