User (Legacy) Posted March 14, 2005 Report Share Posted March 14, 2005 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++ exception. 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 ) ) ) { // VARIANT Val; // 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 More sharing options...
Software FX Posted March 15, 2005 Report Share Posted March 15, 2005 _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: VARIANT v; 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 More sharing options...
User (Legacy) Posted March 15, 2005 Author Report Share Posted March 15, 2005 Thanks, That was the problem. "SoftwareFX Support" <noreply@softwarefx.com> wrote in message news:ShXjA7WKFHA.1924@webserver3.softwarefx.com... > _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: > > VARIANT v; > > 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.