Jump to content
Software FX Community

Segmentation Fault when deleting active annotation object


User (Legacy)
 Share

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

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