The MASM Forum

64 bit assembler => UASM Assembler Development => Topic started by: LiaoMi on June 15, 2020, 08:59:43 PM

Title: Class Effect - classes in UASM
Post by: LiaoMi on June 15, 2020, 08:59:43 PM
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 (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;
};




Title: Re: Class Effect - classes in UASM
Post by: johnsa on June 16, 2020, 09:11:01 PM
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.