Hello
I told you that I use the component from QT in a big app and sending a sample will be a bit difficult.
Code in general is:
//Create an annotation list
measureAnnotList.CreateInstance(__uuidof(AnnotationX)); chart->AddExtension((IUnknown *) measureAnnotList); measureAnnotList->PutToolBar(FALSE);
//Create a handler for the events:
AnnotationsEventHandler *pAnn = new AnnotationsEventHandler((IUnknown *) annotationList);
/The event handler class: AnnotationsEventHandler::AnnotationsEventHandler(IUnknown* intf, QObject* parent, const char* name) : QObject(parent, name) { pAnnotationsEventHandler = new QAxObject ((IUnknown *) intf,this); connect( pAnnotationsEventHandler, SIGNAL( signal(const QString&,int,void*) ), this, SLOT( annotationsSignalDispatch(const QString&,int,void*) ) ); } // slot void AnnotationsEventHandler::annotationsSignalDispatch ( const QString& signalName, int argc, void* argv ) { qDebug("CALLING AnnotationsEventHandler() - SIGNAL: "+signalName);
}
Let me clarify that
connect( pAnnotationsEventHandler, SIGNAL( signal(const QString&,int,void*) ), this, SLOT( annotationsSignalDispatch(const QString&,int,void*) ) );
Catches ALL the events of an activex control so they are relayed to the method annotationsSignalDispatch(const QString&,int,void*)
unfortunately the only event that is received is HRESULT SelectionChanged ( ); while the one i have in tlh are:
struct __declspec(uuid("4b6f58cf-365a-11d1-8fd4-00aa00bd091c")) _AnnotEvents : IDispatch { // // Wrapper methods for error-handling // // Methods: HRESULT LButtonDblClk ( struct IAnnObject * pObj, short * nRes ); HRESULT ObjectCreated ( struct IAnnObject * pObj ); HRESULT ExecuteCommand ( short nID, short * nRes ); HRESULT SelectionChanged ( ); HRESULT StartMoving ( int Left, int Top, int right, int bottom ); HRESULT OnMoving ( ); HRESULT EndMoving ( ); HRESULT ObjectDeleted ( struct IAnnObject * pObj, short * nRes ); };
So if my code catches the selectionchange event then it is implemented properly. The question is why I do not receive the rest of the events that actually I am more interested in.
Do I need to set a flag or something for the measureAnnotList ?
Thank you in advance.