diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp
index 910cacb..19bccbb 100644
--- a/src/activeqt/container/qaxbase.cpp
+++ b/src/activeqt/container/qaxbase.cpp
@@ -82,6 +82,15 @@
 #include "../shared/qaxtypes.h"
 #include "../shared/qaxutils_p.h"
 
+#include <comdef.h>
+#include <shobjidl.h>
+
+static QString stringFromHresult(HRESULT hresult)
+{
+    _com_error error(hresult);
+    return QString::fromWCharArray(error.ErrorMessage());
+}
+
 QT_BEGIN_NAMESPACE
 
 static inline HRESULT Invoke(IDispatch *disp,
@@ -883,6 +892,7 @@ QAxBase::QAxBase(IUnknown *iface)
     d = new QAxBasePrivate();
     d->ptr = iface;
     if (d->ptr) {
+        qDebug() << __FUNCTION__ << iface;
         d->ptr->AddRef();
         d->initialized = true;
     }
@@ -1782,6 +1792,7 @@ QMetaObject *qax_readInterfaceInfo(ITypeLib *typeLib, ITypeInfo *typeInfo, const
 
 QMetaObject *qax_readClassInfo(ITypeLib *typeLib, ITypeInfo *classInfo, const QMetaObject *parentObject)
 {
+    qDebug() << __FUNCTION__;
     MetaObjectGenerator generator(typeLib, nullptr);
     generator.addSignal("exception(int,QString,QString,QString)", "code,source,disc,help");
     generator.addSignal("propertyChanged(QString)", "name");
@@ -2152,10 +2163,12 @@ QByteArray MetaObjectGenerator::guessTypes(const TYPEDESC &tdesc, ITypeInfo *inf
 
 void MetaObjectGenerator::readClassInfo()
 {
+    qDebug() << __FUNCTION__;
     // Read class information
     IProvideClassInfo *provideClassInfo = nullptr;
     if (d)
         d->ptr->QueryInterface(IID_IProvideClassInfo, reinterpret_cast<void **>(&provideClassInfo));
+    qDebug() << __FUNCTION__ << "provideClassInfo=" << provideClassInfo;
     if (provideClassInfo) {
         provideClassInfo->GetClassInfo(&classInfo);
         TYPEATTR *typeattr = nullptr;
@@ -2186,16 +2199,25 @@ void MetaObjectGenerator::readClassInfo()
                 .arg(d->useEventSink).arg(d->useClassInfo).arg(int(qax_dispatchEqualsIDispatch));
     }
 
-    UINT index = 0;
-    if (disp && !dispInfo)
-        disp->GetTypeInfo(index, LOCALE_USER_DEFAULT, &dispInfo);
+    UINT index = 0;    
+    if (disp && !dispInfo) {
+        HRESULT hr = disp->GetTypeInfo(index, LOCALE_USER_DEFAULT, &dispInfo);
+        QDebug d = qDebug();
+        d << __FUNCTION__ << "disp=" << disp << "disp->GetTypeInfo()" << SUCCEEDED(hr) << "dispInfo=" << dispInfo;
+        if (!SUCCEEDED(hr))
+             d << stringFromHresult(hr);
+    }
+    qDebug() << __FUNCTION__ << "disp=" << disp << "dispInfo=" << dispInfo;
 
     if (dispInfo && !typelib)
         dispInfo->GetContainingTypeLib(&typelib, &index);
 
+    qDebug() << __FUNCTION__ << "classInfo=" << classInfo << "typelib1=" << typelib;
     if (!typelib) {
         QSettings controls(QLatin1String("HKEY_LOCAL_MACHINE\\Software"), QSettings::NativeFormat);
-        QString tlid = controls.value(QLatin1String("/Classes/CLSID/") + that->control() + QLatin1String("/TypeLib/.")).toString();
+        QString key = QLatin1String("/Classes/CLSID/") + that->control() + QLatin1String("/TypeLib/.");
+        QString tlid = controls.value(key).toString();
+        qDebug() << __FUNCTION__ << "key=1" << key << "tlid=" << tlid;
         QString tlfile;
         if (!tlid.isEmpty()) {
             controls.beginGroup(QLatin1String("/Classes/TypeLib/") + tlid);
@@ -2207,9 +2229,14 @@ void MetaObjectGenerator::readClassInfo()
             }
             controls.endGroup();
         } else {
-            tlfile = controls.value(QLatin1String("/Classes/CLSID/") + that->control() + QLatin1String("/InprocServer32/.")).toString();
-            if (tlfile.isEmpty())
-                tlfile = controls.value(QLatin1String("/Classes/CLSID/") + that->control() + QLatin1String("/LocalServer32/.")).toString();
+            key = QLatin1String("/Classes/CLSID/") + that->control() + QLatin1String("/InprocServer32/.");
+            tlfile = controls.value(key).toString();
+            qDebug() << __FUNCTION__ << "key=2" << key << "tlfile=" << tlfile;
+            if (tlfile.isEmpty()) {
+                key = QLatin1String("/Classes/CLSID/") + that->control() + QLatin1String("/LocalServer32/.");
+                tlfile = controls.value(key).toString();
+                qDebug() << __FUNCTION__ << "key=3" << key << "tlfile=" << tlfile;
+            }
         }
         if (!tlfile.isEmpty()) {
             LoadTypeLib(reinterpret_cast<const OLECHAR *>(tlfile.utf16()), &typelib);
@@ -2226,9 +2253,11 @@ void MetaObjectGenerator::readClassInfo()
         }
     }
 
+    qDebug() << __FUNCTION__ << "typelib2=" << typelib;
     if (!classInfo && typelib && that)
         typelib->GetTypeInfoOfGuid(QUuid(that->control()), &classInfo);
 
+    qDebug() << __FUNCTION__ << "classInfo=" << classInfo << "dispInfo=" << dispInfo;
     if (classInfo && !dispInfo) {
         TYPEATTR *classAttr;
         classInfo->GetTypeAttr(&classAttr);
@@ -2636,6 +2665,7 @@ void MetaObjectGenerator::readFuncsInfo(ITypeInfo *typeinfo, ushort nFuncs)
 
 void MetaObjectGenerator::readVarsInfo(ITypeInfo *typeinfo, ushort nVars)
 {
+    qDebug() << __FUNCTION__ << "typeinfo=" <<  typeinfo << nVars;
     if (!nVars) {
         TYPEATTR *typeattr = nullptr;
         typeinfo->GetTypeAttr(&typeattr);
@@ -2712,7 +2742,9 @@ void MetaObjectGenerator::readVarsInfo(ITypeInfo *typeinfo, ushort nVars)
 
 void MetaObjectGenerator::readInterfaceInfo()
 {
+
     ITypeInfo *typeinfo = dispInfo;
+    qDebug() << __FUNCTION__ << "dispInfo=" << dispInfo;
     if (!typeinfo)
         return;
     typeinfo->AddRef();
@@ -2749,6 +2781,9 @@ void MetaObjectGenerator::readInterfaceInfo()
             }
         }
 
+        qDebug() << __FUNCTION__ << "loop typeinfo=" << typeinfo << "nFuncs="
+                 << nFuncs << "nVars=" << nVars;
+
         if (interesting) {
             readFuncsInfo(typeinfo, nFuncs);
             readVarsInfo(typeinfo, nVars);
@@ -3009,8 +3044,10 @@ int MetaObjectGenerator::aggregateParameterCount(const QMap<QByteArray, Method>
 
 QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, const QByteArray &className)
 {
+    qDebug() << __FUNCTION__ << className << "that=" << that;
     if (that) {
         readClassInfo();
+        qDebug() << __FUNCTION__ << className << "typelib=" << typelib;
         if (typelib) {
             BSTR bstr;
             typelib->GetDocumentation(-1, &bstr, nullptr, nullptr, nullptr);
@@ -3032,6 +3069,7 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
 #endif
 
     QAxMetaObject *metaobj = new QAxMetaObject;
+    qDebug() << __FUNCTION__ << that;
 
     int paramsDataSize =
             ((aggregateParameterCount(signal_list)
@@ -3121,6 +3159,7 @@ QMetaObject *MetaObjectGenerator::metaObject(const QMetaObject *parentObject, co
     for (auto it = property_list.cbegin(), end = property_list.cend(); it != end; ++it) {
         const QByteArray &name = it.key();
         const QByteArray &type = it.value().type;
+        qDebug() << __FUNCTION__ << that << name << type;
         Q_ASSERT(!type.isEmpty());
         QByteArray realType(it.value().realType);
         if (!realType.isEmpty() && realType != type)
@@ -3264,9 +3303,11 @@ const uint QAxBase::qt_meta_data_QAxBase[] = {
 */
 const QMetaObject *QAxBase::metaObject() const
 {
+
     if (d->metaobj)
         return d->metaobj;
     const QMetaObject* parentObject = parentMetaObject();
+    qDebug() << __FUNCTION__ << parentObject->className();
 
     if (!d->ptr && !d->initialized) {
         const_cast<QAxBase*>(this)->initialize(&d->ptr);
@@ -3296,6 +3337,7 @@ const QMetaObject *QAxBase::metaObject() const
 */
 void QAxBase::connectNotify()
 {
+    qDebug() << __FUNCTION__;
     if (d->eventSink.count()) // already listening
         return;
 
@@ -3488,9 +3530,11 @@ static bool checkHRESULT(HRESULT hres, EXCEPINFO *exc, QAxBase *that, const QStr
 */
 int QAxBase::internalProperty(QMetaObject::Call call, int index, void **v)
 {
+
     const QMetaObject *mo = metaObject();
     const QMetaProperty prop = mo->property(index + mo->propertyOffset());
     QByteArray propname = prop.name();
+    qDebug() << __FUNCTION__ << call << index << propname;
 
     // hardcoded control property
     if (propname == "control") {
@@ -3518,8 +3562,10 @@ int QAxBase::internalProperty(QMetaObject::Call call, int index, void **v)
         return index;
 
     DISPID dispid = d->metaObject()->dispIDofName(propname, disp);
-    if (dispid == DISPID_UNKNOWN)
+    if (dispid == DISPID_UNKNOWN) {
+        qDebug() << __FUNCTION__ << call << index << propname << "DISPID_UNKNOWN";
         return index;
+    }
 
     Q_ASSERT(d->metaobj);
     // property found, so everthing that goes wrong now should not bother the caller
@@ -3543,11 +3589,12 @@ int QAxBase::internalProperty(QMetaObject::Call call, int index, void **v)
             params.rgvarg = nullptr;
 
             hres = Invoke(disp, dispid, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_PROPERTYGET, &params, &arg, &excepinfo, nullptr);
-
+            qDebug() << __FUNCTION__ << call << index << propname << "ok=" << SUCCEEDED(hres);
             // map result VARIANTARG to void*
             uint type = QVariant::Int;
             if (!prop.isEnumType())
                 type = prop.type();
+
             QVariantToVoidStar(VARIANTToQVariant(arg, proptype, type), *v, proptype, type);
             if ((arg.vt != VT_DISPATCH && arg.vt != VT_UNKNOWN) || type == QVariant::Pixmap || type == QVariant::Font)
                 clearVARIANT(&arg);
@@ -3751,6 +3798,7 @@ int QAxBase::qt_static_metacall(QAxBase *_t, QMetaObject::Call _c, int _id, void
 */
 int QAxBase::qt_metacall(QMetaObject::Call call, int id, void **v)
 {
+    qDebug() << __FUNCTION__ << call << id;
     const QMetaObject *mo = metaObject();
     if (isNull() && mo->property(id + mo->propertyOffset()).name() != QByteArray("control")) {
         qWarning("QAxBase::qt_metacall: Object is not initialized, or initialization failed");
@@ -4228,6 +4276,7 @@ QAxObject *QAxBase::querySubObject(const char *name,
 */
 QAxObject *QAxBase::querySubObject(const char *name, QList<QVariant> &vars)
 {
+    qDebug() << __FUNCTION__ << name << vars.size();
     QAxObject *object = nullptr;
     VARIANTARG res;
     VariantInit(&res);
@@ -4239,9 +4288,12 @@ QAxObject *QAxBase::querySubObject(const char *name, QList<QVariant> &vars)
     switch (res.vt) {
     case VT_DISPATCH:
         if (res.pdispVal) {
+
             if (rettype.isEmpty() || rettype == "IDispatch*" || rettype == "QVariant") {
+                qDebug() << __FUNCTION__ << name << rettype << "VT_DISPATCH";
                 object = new QAxObject(res.pdispVal, qObject());
             } else if (QMetaType::type(rettype)) {
+                qDebug() << __FUNCTION__ << name << "meta VT_DISPATCH";
                 QVariant qvar = VARIANTToQVariant(res, rettype, 0);
                 object = *static_cast<QAxObject**>(qvar.data());
 //                qVariantGet(qvar, object, rettype);
diff --git a/src/activeqt/container/qaxobject.cpp b/src/activeqt/container/qaxobject.cpp
index 97a995d..3ad4037 100644
--- a/src/activeqt/container/qaxobject.cpp
+++ b/src/activeqt/container/qaxobject.cpp
@@ -53,7 +53,7 @@
 #include <quuid.h>
 #include <qmetaobject.h>
 #include <qstringlist.h>
-
+#include <qdebug.h>
 #include <windows.h>
 
 QT_BEGIN_NAMESPACE
@@ -190,9 +190,12 @@ const char *QAxObject::className() const
 */
 int QAxObject::qt_metacall(QMetaObject::Call call, int id, void **v)
 {
+    qDebug() << __FUNCTION__ << call << id;
     id = QObject::qt_metacall(call, id, v);
-    if (id < 0)
+    if (id < 0) {
+        qDebug() << __FUNCTION__ << "QObject";
         return id;
+    }
     return QAxBase::qt_metacall(call, id, v);
 }
 
