Results 1 to 3 of 3

Thread: qt use Invoke function, It is error when I use the DISPATCH_PROPERTYPUT.

  1. #1
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qt use Invoke function, It is error when I use the DISPATCH_PROPERTYPUT.

    when I use the Qt to Invoke with DISPATCH_PROPERTYPUT, is error.

    next is my code:
    void CFoxitPDFSDK::SetProperty(DISPID id, VARTYPE put_type, QString put_value) {
    IDispatch *iface = createIDispatch();
    if (iface) {
    VARIANT arg[1];
    arg[0].vt = put_type;
    if(put_type == VT_I4) {
    arg[0].lVal = put_value.toLong();
    qDebug() << put_value.toLong();
    } else if(put_type == VT_BSTR) {

    }
    // EXCEPINFO* e = new EXCEPINFO;


    DISPPARAMS dispparams = {arg, &dispidNamed, 1, 1};
    /* dispparams.cNamedArgs = 1;
    dispparams.rgdispidNamedArgs = &dispidNamed;*/

    HRESULT hresult = iface->Invoke(id, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, NULL);
    if(hresult == S_OK) {
    } else {
    qDebug() << __FUNCTION__ << __LINE__ << hresult;
    qDebug() << DISP_E_BADPARAMCOUNT << "DISP_E_BADPARAMCOUNT";
    qDebug() << DISP_E_BADVARTYPE << "DISP_E_BADVARTYPE";
    qDebug() << DISP_E_EXCEPTION << "DISP_E_EXCEPTION";
    qDebug() << DISP_E_MEMBERNOTFOUND << "DISP_E_MEMBERNOTFOUND";
    qDebug() << DISP_E_NONAMEDARGS << "DISP_E_NONAMEDARGS";
    qDebug() << DISP_E_OVERFLOW << "DISP_E_OVERFLOW";
    qDebug() << DISP_E_PARAMNOTFOUND << "DISP_E_PARAMNOTFOUND";
    qDebug() << DISP_E_TYPEMISMATCH << "DISP_E_TYPEMISMATCH";
    qDebug() << DISP_E_UNKNOWNINTERFACE << "DISP_E_UNKNOWNINTERFACE";
    qDebug() << DISP_E_UNKNOWNLCID << "DISP_E_UNKNOWNLCID";
    qDebug() << DISP_E_PARAMNOTOPTIONAL << "DISP_E_PARAMNOTOPTIONAL";

    // qDebug() << QString::fromUtf16((const ushort*)e->bstrSource);
    // qDebug() << QString::fromUtf16((const ushort*)e->bstrDescription);
    }
    releaseIDispatch(iface);
    }
    }

    error is DISP_E_EXCEPTION .
    when I don't add
    DISPPARAMS dispparams = {arg, &dispidNamed, 1, 1};
    /* dispparams.cNamedArgs = 1;
    dispparams.rgdispidNamedArgs = &dispidNamed;*/

    the error is DISP_E_PARAMNOTOPTIONAL


    when I use the DISPATCH_PROPERTYGET, and DISPATCH_METHOD is ok.

    DISPID dispidNamed = DISPID_PROPERTYPUT; I defined it.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qt use Invoke function, It is error when I use the DISPATCH_PROPERTYPUT.

    How is this problem related to Qt? Apart from qDebug() there is not a single Qt call used in the code you posted.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: qt use Invoke function, It is error when I use the DISPATCH_PROPERTYPUT.

    no, when I use the MFC, the error is same

Similar Threads

  1. Can't install qt 5 on OS X - "cant invoke otool" error
    By macmee in forum Installation and Deployment
    Replies: 1
    Last Post: 18th October 2012, 09:08
  2. QComboBox Signals doesn't invoke the called function
    By ladiesfinger in forum Qt Programming
    Replies: 6
    Last Post: 30th December 2010, 16:20
  3. QWaitCondition function wait() error
    By freekill in forum Qt Programming
    Replies: 2
    Last Post: 10th January 2010, 01:54
  4. Replies: 0
    Last Post: 4th November 2009, 10:21
  5. no matching function error
    By arpspatel in forum Qt Programming
    Replies: 4
    Last Post: 16th October 2009, 15:47

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.