Jump to content
Software FX Community

Using IStream with Export function in COM Charting Tool

User (Legacy)

Recommended Posts

I am trying to get Export to work with an IStream which I believe the 

documentation tells me works.

The result of the following code is E_FAIL (Result == E_FAIL)

If I Uncomment the lines that specify VARIANT as VT_STREAM I get a C++


When I specify output to a file it works correctly.

Any samples around to do export/import from a stream?

Thanks in advance!

// ---- Sample Code ----

IStream* pStream = 0;

if ( SUCCEEDED( ::CreateStreamOnHGlobal( 0, true, &pStream ) ) )



// Val.vt = VT_STREAM;

// Val.punkVal=pStream;

_variant_t Val = pStream;

long Result = m_pChart->Export( CHART_CFXOLETEMPLATE, Val );

Link to comment
Share on other sites


That was the problem.

"SoftwareFX Support" <noreply@softwarefx.com> wrote in message


> _variant_t does not allow for VT_STREAM, you need to by-pass _varian_t and

> use a native OLE Variant (VARIANT struct) as follows:




> V_VT(&v) = VT_STREAM;

> V_UNKNOWN(&v) = m_Stm;


> m_pChartFX->raw_Export(CHART_CFXOLETEMPLATE,v,&lResult);



> --

> FP

> Software FX


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.

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.


  • Create New...