hminky Posted September 7, 2007 Report Share Posted September 7, 2007 Dear, 1. Could you show me C++ sample code how to use mousemove event and hittest with annotation ?I tested my sample code, but not works.I can't catch mouse event when annontation object is under the mouse. I guess the mouse event is going to annotation object, but how can I catch it? 2. how to use SelectList Cfx62Annotation::_AnnotationXPtr m_AnnotationPtr;m_AnnotationPtr.CreateInstance(__uuidof(Cfx62Annotation::AnnotationX)); VARIANT varExtension;V_VT(&varExtension) = VT_DISPATCH;V_DISPATCH(&varExtension) = m_AnnotationPtr;m_chartPtr->Extensions->Add(varExtension); _AnnotationListBasePtr annotationPtr = m_AnnotationPtr->SelectionList;if(annotationPtr) {//annotation object is selected}else{//annotation object is not selected} In above code,I think, I can get current annotation selectlist.but, even if there is no annotation object, SelectionList is not null. How do I know any annotation is selected?SelectionList is _AnnotationListBasePtr and has no method, property. Link to comment Share on other sites More sharing options...
maximop Posted December 13, 2007 Report Share Posted December 13, 2007 You can implement the MouseMove Event as follows: void C_AnnotationCircleDlg::OnMouseMoveChart1(LPDISPATCH sender, LPDISPATCH args) { // TODO: Add your control notification handler code here _MouseEventArgsXPtr myArgs = (_MouseEventArgsXPtr)args; _AnnotationXPtr annotX = annot; if ( annotX != NULL ) { _AnnotationObjectPtr pObj; pObj = annotX->HitTest( myArgs->X, myArgs->Y ); if ( pObj != NULL ) { _GUID iid = __uuidof(_AnnotationCircle); IUnknown ** ptr = NULL; HRESULT hr; hr = pObj->QueryInterface(iid, (void **)&ptr); if ( !FAILED(hr) ) { text->Visible = true; } } } myArgs->Handled = true; } Please note that the above will work only if you have the annot->Enabled property set to "false". Link to comment Share on other sites More sharing options...
GameTheory Posted August 31, 2010 Report Share Posted August 31, 2010 Does anybody know how to implement this in VB 6. I'm having a nightmare with Annotations, nothing seems to work like the manuals indicate and i'm not getting much help. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.