Jump to content
Software FX Community

Re: Syntax help


Software FX

Recommended Posts

First of all you need to instantiate the datafile object. Calling

CreateInstance will do this.

Second, you need to convert your pointer to a VARIANT, this however is not

done automatically by the variant_t class. You must do this manually as

follows:

VARIANT var;

VARIANT DataProvider;

VariantInit(&var);

VariantInit(&DataProvider);

V_VT(&var) = VT_EMPTY;

V_VT(&DataProvider) = VT_DISPATCH;

V_DISPATCH(&DataProvider) = datafile;

HRESULT hr = m_pChartFX->GetExternalData(DataProvider,var);

--

Frank

SFX

"Edward Evans" <eevans@pacsim.com> wrote in message

news:E7U$chkLAHA.2224@sfxserver.softwarefx.com...

> What's the correct C++ syntax for passing in a text file to the chart?

> What I've got now gives me compiler errors:

>

> ICfxDataFilePtr datafile;

> datafile->FileName = "foo.csv";

> m_pChartFX->GetExternalData( datafile );

>

> Casting "datafile" to "_variant_t" crashes the chart.

>

> TIA,

>

> -Ed Evans

>

>

>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...