Jump to content
Software FX Community

Problem to save in stream


User (Legacy)

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

Archived

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

×
×
  • Create New...