User (Legacy) Posted February 27, 2002 Report Share Posted February 27, 2002 I've created an annotation list which I attach to my ChartFX pointer. IChartFXPtr m_pFX; IAnnListPtr m_pAnnList; // annotations m_pAnnList.CreateInstance(__uuidof( AnnotationX )); m_pAnnList->CFX98_ToolBar = FALSE; m_pFX->AddExtension((IUnknown *)m_pAnnList); I then create data region labels which I store in an array. IAnnTextPtr regionLabels[50]; // Loop through 50 times regionLabels[i] = m_pAnnList->Add((short) OBJECT_TYPE_TEXT); I've created an array of gridlines with IAnnArrowPtr similarly. My problem is that I've been attempting to export this graph setup so that I can simply reimport it in an ActiveX control without having to reimplement the code. I've used the following export/import functions while I've been testing it. HRESULT hr = m_pFX->Export( CHART_CFXOLEFILE, CComVariant( CComBSTR("D:\\dutycycle.chd") ) ); HRESULT hr = m_pFX->Import( CHART_CFXOLEFILE, CComVariant( CComBSTR("D:\\dutycycle.chd") ) ); The array of IAnnArrowPtrs has exported and imported without any problems. However, the array of IAnnTextPtr does not seem to be exporting/importing correctly. I placed the export command at the end of my initialization function after I had created everything. I then replaced the initialization function with the import command. Unfortunately when I attempted to update the array of IAnnTextPtrs with data, my program threw an error. Is the IAnnTextPtr in fact successfully importing and exporting? Is my problem the fact that I need to somehow reattach the IAnnTextPtr that was imported back to my member variable? Should I simply recreate that array and not worry about trying to import and export it? Thanks, Jeremy Anthony Link to comment Share on other sites More sharing options...
Software FX Posted February 27, 2002 Report Share Posted February 27, 2002 Yes, your member variable can not be affected by the chart import. Do the text appear in the chart ? if so, they were imported correctly you have to then call GetExtension to get a pointer to the SAVED annotation list and then go through it. -- FP Software FX, Inc. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.