Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Closed] How to give user defined data type within slot?
QtWS25 Last Chance

[Closed] How to give user defined data type within slot?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    feedmeqt
    wrote on last edited by
    #1

    I've two COM objects.

    comTry.h (COM developed in QT) & plainCom.h (COM developed in pure C++).

    Now my problem is that, from plainCom class, I can only access Hello() method of comTry class.

    After reading some QT documentation, COM class methods need to be exposed outside, then it should be declared in public slots, which I've done but still I couldn't access it.

    Further analysis on *.idl file, its mentioned as unsupported type.(But, I've registered with meta-object). Any idea?.
    @
    //comtry.idl ----

    dispinterface ICOMTry
    {
    properties:

    methods:
    [id(1)] void Hello();
    /****** Slot parameter uses unsupported datatype
    [id(2)] void justTry([in] LPSAMPLE p_sample);
    ******/
    };

    [
    uuid(0D93BAE5-0C6B-43DF-ABC4-AD5CF7313FCE),
    helpstring("COMTry Events Interface")
    ]
    dispinterface ICOMTryEvents
    {
    properties:
    methods:
    /****** Signal parameter uses unsupported datatype
    [id(1)] void destroyed([in] QObject p0);
    ******/
    [id(2)] void destroyed_1();
    };

    [
    aggregatable,
    helpstring("COMTry Class"),
    uuid(66FD427E-5B47-4110-855A-C2B4F65C7783)
    ]
    coclass COMTry
    {
    [default] dispinterface ICOMTry;
    [default, source] dispinterface ICOMTryEvents;
    };
    @
    @
    //ComTry.h

    #include <ActiveQt/QAxBindable>
    #include <QMetaType>
    #include "externalFile.h"

    Q_DECLARE_METATYPE(LPSAMPLE)

    class COMTry : public QObject , public QAxBindable
    {
    Q_OBJECT

    public:
    COMTry(QObject *parent = 0);

    public slots:
    void Hello();
    void justTry(LPSAMPLE sample);
    private:
    };

    #endif // COMTRY_H
    @

    @
    // externalFile.h

    typedef struct sample {

    int a;
    float b;

    }SAMPLE, *LPSAMPLE;

    @

    1 Reply Last reply
    0
    • G Offline
      G Offline
      goetz
      wrote on last edited by
      #2

      Looks like the very same problem as in your "older thread":/forums/viewthread/11714/, isn't it?

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • F Offline
        F Offline
        feedmeqt
        wrote on last edited by
        #3

        Well, your correct. Since I'm not able to find the solution. I'm not getting whether this can be done or not.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #4

          Duplicating a thread is usually not a means to push a problem. You're not going to reach more co-developers this way, but risk to annoy some that might be of help otherwise. Please stick to the first thread, mentioned earlier - thanks. I'm closing this one.

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved