Jump to content
Software FX Community

Exporting an Annotation List with a Graph


User (Legacy)
 Share

Recommended Posts

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

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