diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp
index c313a42..33bf93c 100644
--- a/src/activeqt/container/qaxbase.cpp
+++ b/src/activeqt/container/qaxbase.cpp
@@ -3637,6 +3637,7 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
 {
     Q_ASSERT(call == QMetaObject::InvokeMetaMethod);
     Q_UNUSED(call);
+    qDebug() << __FUNCTION__;
 
     // get the IDispatch
     IDispatch *disp = d->dispatch();
@@ -3684,6 +3685,8 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
         else
             params.rgvarg = new VARIANTARG[params.cArgs];
     }
+    for (VARIANTARG *vp = params.rgvarg, *vEnd = params.rgvarg + params.cArgs; vp < vEnd; ++vp)
+        VariantInit(vp);
 
     int p;
     for (p = 0; p < (int)params.cArgs; ++p) {
@@ -3693,6 +3696,8 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
         QVariant qvar;
         if (vt != QVariant::UserType && vt != int(QMetaType::QVariant))
             qvar = QVariant(vt, v[p + 1]);
+        qDebug() << "  IN loop, p="<< p << "qvar=" << qvar << "type=" << type
+                 << "out=" << out;
 
         if (!qvar.isValid()) {
             if (type == "IDispatch*")
@@ -3706,7 +3711,7 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
             else
                 qvar = QVariant(QMetaType::type(type), v[p + 1]);
         }
-
+        qDebug() << "  modified qvar="<< qvar;
         QVariantToVARIANT(qvar, params.rgvarg[params.cArgs - p - 1], type, out);
     }
 
@@ -3718,27 +3723,34 @@ int QAxBase::internalInvoke(QMetaObject::Call call, int index, void **v)
     EXCEPINFO excepinfo;
     memset(&excepinfo, 0, sizeof(excepinfo));
 
+    qDebug() << __FUNCTION__ << ">INVOKE";
     WORD wFlags = isProperty ? DISPATCH_PROPERTYPUT : DISPATCH_METHOD | DISPATCH_PROPERTYGET;
     hres = Invoke(disp, dispid, IID_NULL, LOCALE_USER_DEFAULT, wFlags, &params, &ret, &excepinfo, &argerr);
+    qDebug() << __FUNCTION__ << "<INVOKE" << SUCCEEDED(hres);
 
     // get return value
-    if (hres == S_OK && ret.vt != VT_EMPTY)
+    if (hres == S_OK && ret.vt != VT_EMPTY) {
+        qDebug() << "  convert return";
         QVariantToVoidStar(VARIANTToQVariant(ret, slot.typeName()), v[0], slot.typeName());
+    }
 
     // update out parameters
-    for (p = 0; p < (int)params.cArgs; ++p) {
+    for (p = 0; p < (int)params.cArgs; ++p) {        
         bool out;
         QByteArray ptype = d->metaobj->paramType(signature, p, &out);
+        qDebug() << "  OUT loop, p="<< p << "ptype=" << ptype << "out=" << out;
         if (out)
             QVariantToVoidStar(VARIANTToQVariant(params.rgvarg[params.cArgs - p - 1], ptype), v[p+1], ptype);
     }
     // clean up
+    qDebug() << "  cleanup";
     for (p = 0; p < (int)params.cArgs; ++p)
         clearVARIANT(params.rgvarg+p);
     if (params.rgvarg != static_rgvarg)
         delete [] params.rgvarg;
 
     checkHRESULT(hres, &excepinfo, this, QString::fromLatin1(slotname), params.cArgs-argerr-1);
+    qDebug() << __FUNCTION__ << "returns" << index;
     return index;
 }
 
diff --git a/src/activeqt/shared/qaxtypefunctions.cpp b/src/activeqt/shared/qaxtypefunctions.cpp
index 3dc96f8..a25da46 100644
--- a/src/activeqt/shared/qaxtypefunctions.cpp
+++ b/src/activeqt/shared/qaxtypefunctions.cpp
@@ -40,6 +40,7 @@
 
 #include <qt_windows.h>
 #include "qaxtypefunctions.h"
+#include "qaxutils_p.h"
 #include <qcursor.h>
 #include <qpixmap.h>
 #include <qsize.h>
@@ -48,6 +49,11 @@
 
 QT_BEGIN_NAMESPACE
 
+static inline QDebug operator<<(QDebug d, const VARIANT &v)
+{
+    return qaxFormatVariant(d, v);
+}
+
 QColor OLEColorToQColor(uint col)
 {
     return QColor(GetRValue(col),GetGValue(col),GetBValue(col));
@@ -68,6 +74,7 @@ QColor OLEColorToQColor(uint col)
 */
 bool QVariantToVoidStar(const QVariant &var, void *data, const QByteArray &typeName, uint type)
 {
+     qDebug() << __FUNCTION__ << var << "typeName=" << typeName << "type=" << type;
     if (!data)
         return true;
 
@@ -155,6 +162,7 @@ bool QVariantToVoidStar(const QVariant &var, void *data, const QByteArray &typeN
 
 void clearVARIANT(VARIANT *var)
 {
+    qDebug() << __FUNCTION__ << *var;
     if (var->vt & VT_BYREF) {
         switch (var->vt) {
         case VT_BSTR|VT_BYREF:
diff --git a/src/activeqt/shared/qaxtypes.cpp b/src/activeqt/shared/qaxtypes.cpp
index 0515742..620ec89 100644
--- a/src/activeqt/shared/qaxtypes.cpp
+++ b/src/activeqt/shared/qaxtypes.cpp
@@ -77,6 +77,11 @@ GUID IID_IAxServerBase = { 0xbd2ec165, 0xdfc9, 0x4319, { 0x8b, 0x9b, 0x60, 0xa5,
 extern void *qax_createObjectWrapper(int metaType, IUnknown *iface);
 #endif
 
+static inline QDebug operator<<(QDebug d, const VARIANT &v)
+{
+    return qaxFormatVariant(d, v);
+}
+
 static IFontDisp *QFontToIFont(const QFont &font)
 {
 #if defined(Q_OS_WINCE)
@@ -245,6 +250,9 @@ static QByteArray msgOutParameterNotSupported(const QByteArray &type)
 */
 bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &typeName, bool out)
 {
+    qDebug() << __FUNCTION__  << var << '(' << (int)(var.type()) << ") &var=" << (void*)&var << "arg=" << arg
+             << "typeName=" << typeName << "out=" << out;
+
     QVariant qvar = var;
     // "type" is the expected type, so coerce if necessary
     QVariant::Type proptype = typeName.isEmpty() ? QVariant::Invalid : QVariant::nameToType(typeName);
@@ -733,6 +741,8 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
                 subType.truncate(subType.length() - 1);
 #endif
             if (!qstrcmp(qvar.typeName(), "IDispatch*")) {
+                IDispatch *id = qvariant_cast<IDispatch *>(qvar);
+                qDebug() << "->var" << id;
                 if (out) {
                     qWarning().noquote() << msgOutParameterNotSupported(qvar.typeName());
                     arg.vt = VT_EMPTY;
@@ -807,10 +817,12 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
         break;
 
     default:
+        qDebug() << __FUNCTION__  <<  "<returns false";
         return false;
     }
 
     Q_ASSERT(!out || (arg.vt & VT_BYREF));
+    qDebug() << __FUNCTION__  <<  "<returns" << arg;
     return true;
 }
 
@@ -834,6 +846,8 @@ bool QVariantToVARIANT(const QVariant &var, VARIANT &arg, const QByteArray &type
 */
 QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint type)
 {
+    qDebug() << __FUNCTION__  <<  arg << "typeName=" << typeName << "type=" << type;
+
     QVariant var;
     switch(arg.vt) {
     case VT_BSTR:
@@ -1322,6 +1336,7 @@ QVariant VARIANTToQVariant(const VARIANT &arg, const QByteArray &typeName, uint
             var = QVariant();
         }
     }
+    qDebug() << __FUNCTION__  <<  "<returns" << var;
     return var;
 }
 
diff --git a/src/activeqt/shared/qaxutils.cpp b/src/activeqt/shared/qaxutils.cpp
index 92567ef..603aeae 100644
--- a/src/activeqt/shared/qaxutils.cpp
+++ b/src/activeqt/shared/qaxutils.cpp
@@ -220,4 +220,19 @@ HRGN qaxHrgnFromQRegion(const QRegion &region)
     return hRegion;
 }
 
+#ifndef QT_NO_DEBUG
+QDebug qaxFormatVariant(QDebug d, const VARIANT &v)
+{
+    QDebugStateSaver s(d);
+    d.nospace();
+    d << "VARIANT(vt=" << (v.vt & VT_TYPEMASK) << ", ";
+    if (v.vt & VT_BYREF)
+        d << "BYREF, ";
+    if (v.vt & VT_ARRAY)
+        d << "ARRAY, ";
+    d << (const void *)(v.pulVal) << ')';
+    return d;
+}
+#endif // !QT_NO_DEBUG
+
 QT_END_NAMESPACE
diff --git a/src/activeqt/shared/qaxutils_p.h b/src/activeqt/shared/qaxutils_p.h
index bc7d8c4..84ca8ab 100644
--- a/src/activeqt/shared/qaxutils_p.h
+++ b/src/activeqt/shared/qaxutils_p.h
@@ -61,6 +61,9 @@ class QWidget;
 class QPixmap;
 class QRect;
 class QRegion;
+#ifndef QT_NO_DEBUG
+class QDebug;
+#endif
 
 enum HBitmapFormat
 {
@@ -74,6 +77,10 @@ HBITMAP qaxPixmapToWinHBITMAP(const QPixmap &p, HBitmapFormat format = HBitmapNo
 QPixmap qaxPixmapFromWinHBITMAP(HBITMAP bitmap, HBitmapFormat format = HBitmapNoAlpha);
 HRGN qaxHrgnFromQRegion(const QRegion &region);
 
+#ifndef QT_NO_DEBUG
+QDebug qaxFormatVariant(QDebug d, const VARIANT &v);
+#endif
+
 QT_END_NAMESPACE
 
 #endif
