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.

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}}

This will be included in the next SP of CoLib (in CoLib.inc)
Posted on 2001-02-22 09:41:00 by Ernie