Jump to content
Software FX Community

Delphi6, ChartFx98 and 'Invalid variant operation'

User (Legacy)

Recommended Posts

I did a little digging and this is what I found:

Exception is raised on the last line of the following function in


procedure VarClearDeep(var V: TVarData);


LHandler: TCustomVariantType;


// quick test for the simple ones

if (V.VType < varInt64) then



// ok, finally is it a custom variant type?

else if FindCustomVariantType(V.VType, LHandler) then





I debugged this code with ChartFx, and the reason is that V.VType

was set to 33828. That's way more then the max possible type set

in D6 to 2047.

If you look at the code that was responsible for clearing variants in Delphi

5, it seems that unknown types where just thrown at oleaut.dll and ignored,

that might be the reason that control was working in D5.

So, the working hack-around to be able to create in D6 a TChartFx object at

runtime is to change Variants.pas to ignore the unknown types.

My question is: does ChartFx control has code that is not compatible

with D6? Custom variant types need to be declared and can't be above 2047.

Or is it the way D6 retreives variants that is flawed? If anyone can provide


technical details about this issue, I'd appreciate that.


Mikhail Khilkov

Senior Software Engineer

NEC Integrated Applications Division


Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...