Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QDrag / QDropEvent combase error : Class not registered



  • Hi everyone,

    I'm using standard Qt drag / drop event code to transfer data between two test widgets. Everything works well, except that I get the combase error below and GUI thread stalls when I start either event (e.g. when I drag the mouse over the widget receiving the event). I'm running Qt 5.12.0 MSVC2017 64 bit on a 64 bit Windows 10 machine.

    onecore\com\combase\dcomrem\resolver.cxx(2491)\combase.dll!00007FFD1A377992: (caller: 00007FFD1A2C2075) ReturnHr(1) tid(399c) 80040154 Class not registered
    

    Drag event and mime data creation:

    QDrag *drag = new QDrag(this);
    
    QString text = QString("TEXT");
    
    QMimeData *mimeData = new QMimeData();
    mimeData->setText(text);
    
    drag->setMimeData(mimeData);
    
    Qt::DropAction dropAction = drag->exec(Qt::CopyAction|Qt::MoveAction);
    

    Drop events in the test widget:

    void TestWidget::dragMoveEvent(QDragMoveEvent *event)
    {
        if(event->mimeData()->hasUrls() || event->mimeData()->hasText())
            event->acceptProposedAction();
    }
    
    void TestWidget::dragEnterEvent(QDragEnterEvent *event)
    {
        if(event->mimeData()->hasUrls() || event->mimeData()->hasText())
            event->acceptProposedAction();
    }
    
    void TestWidget::dropEvent(QDropEvent *event)
    {
        qDebug()<<event->mimeData()->text();
    }
    
    

    Have you seen this issue before? How do I start troubleshooting this?

    Cheers!


  • Lifetime Qt Champion

    Hi,

    Might be unrelated to Qt.

    See this bug report for example.



  • @SGaist

    Thanks! I looked at a few different threads and thought maybe this is related to Windows 32-bit vs 64-bit DLLs.

    I compiled a 32-bit version and the problem remained. I tried Release builds for both 32-bit and 64-bit and the problem went away. Maybe the MSVC debugger is not finding some DLLs or has incorrect settings?

    If you have any tips on troubleshooting further I would definitely appreciate it!

    Cheers!


  • Lifetime Qt Champion

    Do you have the same issue if you start one of the Qt drag and drop examples ?



  • @SGaist Yes, I see the same issue with the examples in MSVC debug builds, but release works without errors


  • Lifetime Qt Champion

    Would it be possible to test a more recent version of Visual Studio ?



  • @SGaist Later than MSVC 2017 or a Qt Creator version later than 4.5.0?


  • Lifetime Qt Champion

    MSVC or rather the compiler. Qt Creator shall have nothing to do with that issue.

    You could also check with the MinGW build to see if you have a similar issue. It might be less intrusive than adding another VS installation to your machine.



  • @SGaist Good point, I'll try the MINGW build first and post the results. Thanks for your help!