0

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

FadiBitar
  • 11
  • 2
  • 1
    Are you having trouble compiling the code from the Eclipse IDE, or is it Eclipse's parser showing red squiggles? Also, why did you decide to switch to Eclipse to develop a COM application? – Praetorian Apr 02 '13 at 16:23
  • I'm getting build errors, so I guess it's not just a parser issue. I'm moving to Eclipse because I'm developing modules in different languages that will interact with my application, notably in Django (python), so instead of doing the development for each module in a seperate IDE, I figured I'd have everything in the same place – FadiBitar Apr 02 '13 at 16:37
  • If you want my opinion, it's not worth the trouble to figure this out; especially since you had it working. VS handles COM projects seamlessly, just use that for the COM part of your application. Develop the Python and whatever other bits using Eclipse, or even something else that may be better for that specific task. Basically, use the best tools available for the job, instead of trying to shoehorn everything into a single tool. – Praetorian Apr 02 '13 at 16:52

0 Answers0