This is the struct that I need to write to, I can not change it as it's part of Firefox's api.
It's been a long time since I've used unions and I don't remember how to write to it, and I think I've forgotten how to. I seemed to think that unionable items all had to be the same size (maybe that was just C.)Code:typedef struct _NPVariant { NPVariantType type; union { bool boolValue; int32_t intValue; double doubleValue; NPString stringValue; NPObject *objectValue; } value; } NPVariant;
But anyway, here my method is passed one of these structs via pointer from an external dll (which I also have no control over, it's the firefox flash plugin.)
Code:result -> type = NPVariantType_Int32; int32_t ii = ((Area*)PluginOwnerNPP) -> AbsTop.GetValuei(); //returns an int result -> value = ii; //result -> intValue = ii;


Reply With Quote

Bookmarks