Jump to content
Software FX Community

Segmentation Fault when deleting active annotation object


User (Legacy)

Recommended Posts

Hi,

I'm trying to eliminate a segmentation fault when deleting or cutting active

(in editing mode) annotation object. (please see attached file for details)

The possible workaround I thought was to deactivate before annotation object

is deleted.

I wrote the following code, but the object was not deleted.

What's wrong with my code?

HRESULT CAnoEventLink::ExecuteCommand(short nID, short* nRes)

{

IAnnListPtr pAnnList =

(IAnnListPtr)m_pChartCtrl->GetExtension("AnnotationX.AnnList");

switch(nID) {

case ID_OBJECT_CUT:

case ID_OBJECT_DELETE:

{

IAnnGroupPtr pAnnGroup = pAnnList->GetCurSel();

pAnnList->ClearActive();

if(nID == ID_OBJECT_CUT) {

pAnnList->Copy();

}

pAnnGroup->Remove(_variant_t(short(-1))); // it doesn't work!

//pAnnGroup->Refresh(VARIANT_FALSE);

m_pChartCtrl->Refresh();

*nRes = 1;

break;

}

}

return S_OK;

}

I'm using cfx4032.ocx (Ver. 5.0.14.5), AnnotateX.dll (Ver. 1.0.32.1) and

sfxbar.dll (Ver. 1.0.23.0) on WindowsXP-SP2

Regards,

---

Masayuki Amano

Matsushita Electric Works, Ltd.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...