Jump to content
Software FX Community

Problem to save in stream


User (Legacy)
 Share

Recommended Posts

ChartFX write nothing in my stream.

There is no error in return export function, but IStream::Stat function

retrieve no size.

If I try to export with CHART_CFXOLEFILE, I have an error: 0x800004005.

What may be the problem?

Thanking you in advance,

sample code:

-------------

IStreamPtr pStream;

HRESULT hResult = CreateStreamOnHGlobal (NULL, TRUE, &pStream);

VARIANT varValue;

if (SUCCEEDED(hResult))

{

V_VT(&varValue) = VT_UNKNOWN;//VT_STREAM;

V_UNKNOWN(&varValue) = m_pStream;

hResult = m_pChartFX->Export(CHART_CFXFILE, varValue);

STATSTG stg;

memset (&stg, 0x00, sizeof(STATSTG));

hResult = m_pStream->Stat (&stg, 0);

}

Link to comment
Share on other sites

You need to use the following code:

V_VT(&varValue) = VT_STREAM;

V_UNKNOWN(&varValue) = m_pStream;

m_pChartFX->raw_Export(CHART_CFXFILE, &varValue,&hResult);

The _variant_t wrapper can't handle VT_STREAM

--

FP

Software FX Support

"pascal j." <pascal.jubeauxREMOVEME@dataset.frNOSPAM> wrote in message

news:olTd2TppCHA.2684@webserver1.softwarefx.com...

> ChartFX write nothing in my stream.

> There is no error in return export function, but IStream::Stat function

> retrieve no size.

> If I try to export with CHART_CFXOLEFILE, I have an error: 0x800004005.

>

> What may be the problem?

>

> Thanking you in advance,

>

>

> sample code:

> -------------

> IStreamPtr pStream;

> HRESULT hResult = CreateStreamOnHGlobal (NULL, TRUE, &pStream);

> VARIANT varValue;

>

> if (SUCCEEDED(hResult))

> {

> V_VT(&varValue) = VT_UNKNOWN;//VT_STREAM;

> V_UNKNOWN(&varValue) = m_pStream;

> hResult = m_pChartFX->Export(CHART_CFXFILE, varValue);

> STATSTG stg;

> memset (&stg, 0x00, sizeof(STATSTG));

> hResult = m_pStream->Stat (&stg, 0);

> }

>

>

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...