I had a bad time yesterday initializing some variant types in my .data section. Previously I've used variants as LOCALS, and had no trouble.
Eventually, I realised they should be inited like so:
MyVariant VARIANT {VT_I4, , , , {10}}
This is due to variants having 3 reserved words inside, plus the value is inside a UNION.
Hrmmm... looks dang ugly to me. Perhaps it should have a macro.
proto:
DeclareVARIANT VarName, VarType, VarValue
Typical example:
DeclareVARIANT MyVariant, VT_I4, 10
The macro:
DeclareVARIANT MACRO VarName:REQ, VarType:REQ, VarValue:REQ
VarName VARIANT {VarType, , , , {VarValue}}
ENDM
[\code]
This will be included in the next SP of CoLib (in CoLib.inc)