User (Legacy) Posted August 28, 2005 Report Share Posted August 28, 2005 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.