Jump to content
Software FX Community

Re: Syntax help


Software FX
 Share

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...