Results 1 to 2 of 2

Thread: Listening events of a QAxServer module

  1. #1
    Join Date
    Jan 2006
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Listening events of a QAxServer module

    Hello,

    It's nice to be in this cool place I hope I can help any of you sometimes..

    If this question is out of the scope of this section, just ignore or remove it.

    I have done an Active X control (using QAXFACTORY_DEFAULT macro) that I need to load in a host client which is an app done in VC++6. The control loads fine inside the host app and I can set/get the properties I have exposed. My only problem is that I have not found a way to achieve that the host client listens the events of the Ax server.

    Looking into the tlh file generated by QT, it defines this interfaces:
    Qt Code:
    1. struct __declspec(uuid("9e7f7f6c-7119-4b74-958b-ca9a6680b6b6"))
    2. /* dispinterface */ IMyControl;
    3. struct __declspec(uuid("af804d11-3361-46bb-8173-4ca5f0eda476"))
    4. /* dispinterface */ IMyControlEvents;
    5. struct /* coclass */ MyControl;
    To copy to clipboard, switch view to plain text mode 
    And the events interface exposes the only signal I have defined ( signalTest ):

    Qt Code:
    1. struct __declspec(uuid("af804d11-3361-46bb-8173-5ca9f0eda476"))
    2. IMyControlEvents: IDispatch
    3. {
    4. // Methods:
    5. HRESULT destroyed_1 ( );
    6. HRESULT customContextMenuRequested (
    7. struct QPoint p_pos );
    8. HRESULT signalTest ( );
    9. };
    To copy to clipboard, switch view to plain text mode 

    So everything looks fine, now I just need the host app knows when this control notifies an event. I have searched a lot and it seems I have to implement a class in the client that inherits from the events interface of the AxServer.

    Something like:

    Qt Code:
    1. class ATL_NO_VTABLE CMyControlEvents :
    2. public IDispatchImpl<IMyControlEvents, &__uuidof(IMyControlEvents), &__uuidof(__MyControlLib)>
    3. {
    4. public:
    5. CMyControlEvents ()
    6. {
    7. }
    8. DECLARE_PROTECT_FINAL_CONSTRUCT()
    9. HRESULT FinalConstruct()
    10. {
    11. return S_OK;
    12. }
    13. void FinalRelease()
    14. {
    15. }
    16. STDMETHOD(OnSignalTest)(void);
    17. };
    To copy to clipboard, switch view to plain text mode 

    But actually I have not experience at all in this field ATL-COM and I am completely lost.
    I am using Qt 4.2.1 full licensed, perhaps this forum is only for questions about the free edition; if so, please sorry and remove it.

    Many thanks for your help

    Juan
    Last edited by e8johan; 13th November 2006 at 06:20. Reason: missing [code] tags

  2. #2
    Join Date
    Feb 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Listening events of a QAxServer module

    Hi,

    I would like to know if a solution was found to this problem, because I'm stuck on a similar problem myself, and I don't seem to get out.

    Thanx

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.