I'm developing a C++ application that reads and writes to Excel using OLE automation (code based on this: http://support.microsoft.com/kb/216686).
The application has been up and running just fine when I was using VS2010. However recently I decided to move to Eclipse, and all of a sudden the compiler (CL) won't recognize the structure of the VARIANT struct (doc: http://msdn.microsoft.com/en-us/library/aa908601.aspx). For instance in this piece of code:
VARIANT tmp;
tmp.vt = VT_R4;
tmp.fltVal = 5.0f;
tmp.fltVal cannot be resolved in Eclipse (while it works just fine in VS2010, and every code sample I've seen online). The only way to get Eclipse to stop displaying an error is to replace the last two lines with:
tmp.n1.n2.vt = VT_R4;
tmp.n1.n2.n3.fltVal = 5.0f;
Same goes for tmp.parray and all other members of VARIANT. Has anyone come across this before ? What am I missing here ?
PS: No, replacing the code everywhere is not exactly an option