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. Class has no metaobject information?
Forum Updated to NodeBB v4.3 + New Features

Class has no metaobject information?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 4.4k Views 1 Watching
  • 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

    Hi,

    I've created a singleton class(dll ), plain dll and another COM dll in QT(non GUI, all derving from QObject & Q_OBJECT also added). Now, When I'm accessing the singleton class/plain dll methods inside the COM dll, an error pops up "Class has no metaobject information?" . I don't understand the meaning of it. I'm using VS2010 and QT4.7.4.

    After searching for information regarding this error in qtfroum , i found some similar topic "here":http://developer.qt.nokia.com/forums/viewthread/10836 , But, cmdline i've not tried and expecting some solution might be there.

    Totally stuck here!!! :(. Need some direction.

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

      From what you write, it's hard to say where the problem is.
      First of all, I asume you are on windows (COM :-) ).
      Which compiler tool chain do you use?
      How do your classes (especially the exported ones) look like?

      Nokia Certified Qt Specialist.
      Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

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

        Ok, I've tried from CMDLine its working. But like to know the root cause for it.
        Here is my class interface,

        @
        // COM dll (no UI component)
        #include <ActiveQt/QAxBindable>

        #include "classM.h"
        #include "classA_global.h"

        #include <qobject.h>
        #include <QMetaObject>

        struct key {

        int someVar;
        };

        // ,
        class CLASSA_EXPORT classA : public QObject, public QAxBindable , public scanner
        {
        Q_OBJECT
        public:
        classA( QObject p = 0);
        STDMETHOD(Init)(LPTNTDRVINFO pDrvInfo); // 3rd part "scanner" virtual function
        ULONG STDMETHODCALLTYPE AddRef( void);
        ULONG STDMETHODCALLTYPE Release( void);
        STDMETHOD(QueryInterface)(
        /
        [in] / REFIID riid,
        /
        [iid_is][out] */ __RPC__deref_out void __RPC_FAR *__RPC_FAR *ppvObject);

        public slots:
        QString getSaampleData();
        private:
        //bla bla bla...
        };

        QAXFACTORY_DEFAULT(classA,
        "{20C63A76-5FEF-49C8-8E83-26957590748B}",
        "{BE690126-A3413-47D1-A278-1E69FCD1B61E}",
        "{0DED1E03-D4F2-44C3-8B67-56F4D7D87661}",
        "{5263E150-F234-4AE0-9E38-CBE753E936C0}",
        "{96AB3485-1234-4B60-BB62-5C77C22EF154}")

        // singleton class interface. dll
        #include <QObject>
        #include<QVariant>
        #include <QList>
        #include <QMetaObject>
        #include "singleton_global.h"
        #include <qDebug.h>

        class SINGLETON_EXPORT singleton : public QObject
        {

        Q_OBJECT

        static bool instanceFlag;
        static singleton single;
        singleton();
        singleton(const singleton&);
        public:
        static singleton
        getInstance();
        ~singleton();
        QMap<QString, struct key*> getMapVar();

        private:
        QMap<QString, struct key*> MapVar;

        };

        // implementation of CLASSA(COM object).

        QString ClassA::getSaampleData(){

        QMap<QString, struct key*> tempMapVar;
        tempMapVar = singleton::getInstance()->getMapVar(); // gives error while building , class do not have metaobject...

        }

        // console application

        main() {

        ClassALib::IClassPtr obj;
        HRESULT hr = CoInitialize(NULL);
        if (FAILED(hr))
        {
        #if _DEBUG
        qDebug("CoInitialize Failed");
        #endif
        return -1;
        }

        obj.CreateInstance("{20C63A76-5FEF-49C8-8E83-26957590748B}");
        if(!obj) {
        return -1;
        }
        obj->getSaampleData();

        }
        @

        This is how my interface looks like,

        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