Results 1 to 4 of 4

Thread: QVariant of 'Type.Missing'

  1. #1
    Join Date
    Sep 2010
    Posts
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QVariant of 'Type.Missing'

    In regards to ActiveQT, is there a way of making a QVariant that would be the equivalent of the following VARIANT:

    VARIANT v;
    v.vt = VT_ERROR;
    v.scode = DISP_E_PARAMNOTFOUND;

    I've tried to convert the VARIANT to QVariant, using: VARIANTToQVariant(), however I can not compile the code. Specifically to use VARIANT I included "windows.h" (or "qt_windows.h") and to get the VARIANTToQVariant() I included "qaxtypes.h". As soon as I have both of those, I get the following compile errors:

    c:\Qt\2010.05\qt\lib/libqaxserver.a(qaxservermain.o):qaxservermain.cpp.text+0x478): multiple definition of `WinMain@16'

    c:\Qt\2010.05\qt\lib/libqtmaind.a(qtmain_win.o):C:\qt-greenhouse\Trolltech\Code_less_create_more\Trollte ch\Code_less_create_more\Troll\4.6\qt\src\winmain/../../include/QtCore/../../src/corelib/global/qglobal.h:1381: first defined here

    c:\Qt\2010.05\qt\lib/libqaxserver.a(qaxserver.o):qaxserver.cpp.text+0xe01): undefined reference to `qax_instantiate()'


    Added after 1 19 minutes:


    Further info:
    Tried creating an invalid QVariant() and putting the value (DISP_E_PARAMNOTFOUND) in. From looking at QAx code that seems to be the way to go, however, QAxObject still throws up an error when this QVariant is used.
    Last edited by semajnosnibor; 17th January 2012 at 20:01.

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

    Default Re: QVariant of 'Type.Missing'

    I think you included some file you shouldn't have included and you have two WinMain() functions now.
    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
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QVariant of 'Type.Missing'

    Not sure what the would have been, but regardless, after looking at the code for VARIANTtoQVariant() it doesn't look like it would handle the case of a variant with the .VT = VT_ERROR and the .SCODE = DISP_E_PARAMNOTFOUND. It's interesting though that the QVariantToVARIANT() converts a QVariant::Invalid to a similar VARIANT (though the LVAL is set to DISP_E_PARAMNOTFOUND, and not the SCODE).
    I have tried passing an invalid QVariant(), but no joy.
    Is it actually possible that no one has used ActiveQT with any COM functions requiring these 'Type.Missing' VARIANTS?

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

    Default Re: QVariant of 'Type.Missing'

    Anything is possible
    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.


Similar Threads

  1. QVariant custom type.
    By hickscorp in forum Qt Programming
    Replies: 0
    Last Post: 3rd May 2010, 14:23
  2. Using QVariant with custom data type
    By QAlex in forum Qt Programming
    Replies: 3
    Last Post: 4th December 2009, 12:04
  3. Problem regaridng Type casting QVariant
    By sudheer168 in forum Qt Programming
    Replies: 5
    Last Post: 3rd November 2009, 06:02
  4. Unable to define a new type with QVariant
    By max2g in forum Qt Programming
    Replies: 3
    Last Post: 23rd February 2008, 17:55
  5. QSettings and new QVariant Type
    By baray98 in forum Qt Programming
    Replies: 7
    Last Post: 11th February 2008, 11:40

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.