Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDrag / QDropEvent combase error : Class not registered
QtWS25 Last Chance

QDrag / QDropEvent combase error : Class not registered

Scheduled Pinned Locked Moved Unsolved General and Desktop
qdrag drag dropqdragonecore errorcombase errormime
16 Posts 6 Posters 5.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rtavakko
    wrote on 17 Feb 2021, 18:43 last edited by rtavakko
    #1

    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!

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 17 Feb 2021, 19:12 last edited by
      #2

      Hi,

      Might be unrelated to Qt.

      See this bug report for example.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      R 1 Reply Last reply 22 Feb 2021, 15:01
      1
      • S SGaist
        17 Feb 2021, 19:12

        Hi,

        Might be unrelated to Qt.

        See this bug report for example.

        R Offline
        R Offline
        rtavakko
        wrote on 22 Feb 2021, 15:01 last edited by
        #3

        @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!

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 22 Feb 2021, 19:24 last edited by
          #4

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

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          R 1 Reply Last reply 23 Feb 2021, 20:06
          0
          • S SGaist
            22 Feb 2021, 19:24

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

            R Offline
            R Offline
            rtavakko
            wrote on 23 Feb 2021, 20:06 last edited by
            #5

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

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 23 Feb 2021, 20:30 last edited by
              #6

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

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              R 1 Reply Last reply 23 Feb 2021, 20:44
              0
              • S SGaist
                23 Feb 2021, 20:30

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

                R Offline
                R Offline
                rtavakko
                wrote on 23 Feb 2021, 20:44 last edited by
                #7

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

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 23 Feb 2021, 20:48 last edited by
                  #8

                  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.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  R 1 Reply Last reply 23 Feb 2021, 20:58
                  1
                  • S SGaist
                    23 Feb 2021, 20:48

                    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.

                    R Offline
                    R Offline
                    rtavakko
                    wrote on 23 Feb 2021, 20:58 last edited by
                    #9

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

                    1 Reply Last reply
                    0
                    • T Offline
                      T Offline
                      tiho_d
                      wrote on 16 Mar 2021, 14:02 last edited by tiho_d
                      #10

                      I experience the same error. I am not sure when it started, but the "Class not registered" error comes up during drag-and-drop move operation. As a result the QListView::paintEvent also does not get called. Interestingly when I move out and in the widget still dragging the object the paintEvent function is called.

                      I am using Qt 5.15.3 LTS with the latest fully updated VS2019 Enterprise. This happens when using both x86 and x64 bit builds. I did a full rebuild of my project with all libraries, but the error during drag-and-drop still appears in the debug console window.

                      Some threads suggest that I am using mixed x86/x64 DLLs, but checking all DLLs and binaries report themselves as x86 binaries(respectively x64 in the x64 bit build). (https://stackoverflow.com/questions/1496214/how-to-solve-com-exception-class-not-registered-exception-from-hresult-0x80040)

                      If you have any idea how to detect which module or COM object is causing this error might help. I have not found a way to trace and fix this.

                      Any help is very welcome! Thanks!

                      1 Reply Last reply
                      1
                      • R Offline
                        R Offline
                        rtavakko
                        wrote on 23 Aug 2021, 18:16 last edited by
                        #11

                        Update on this, I tried a MinGW build (5.12.0 64-bit) with similar results. And to correct something I mentioned earlier, this happens both with debug and release builds.

                        An important note is that this happens when a drag event is in progress but it is not catageorized as one of the following:

                        • dragMoveEvent
                        • dragEnterEvent
                        • dragLeaveEvent
                        • dropEvent

                        So if you drag an item and stop on the receiving widget and stop moving the mouse, you will get this error. Maybe the underlying library in Windows is registering a drag event that doesn't involve movement? A 'dragStopEvent'?

                        1 Reply Last reply
                        0
                        • Z Offline
                          Z Offline
                          Zoin
                          wrote on 14 Sept 2021, 20:48 last edited by
                          #12

                          Any progress on this, anyone? I'm facing the same issue, and it makes my DnD very sluggish. I'm calling it from QML, but it seems it doesn't matter much. All the "smooth QML animations" are essentially screwed up

                          1 Reply Last reply
                          1
                          • V Offline
                            V Offline
                            Vladimir Orlov
                            wrote on 21 Sept 2021, 20:49 last edited by Vladimir Orlov
                            #13

                            The same problem. Qt 5.15.2, Qt Creator 5.0.1, VS2019 16.11.3, x86 app on x64 Windows. An interesting thing is that it reproduces in Win10 but in Win8.1 all works well.

                            I've read somewhere that running an app with Administrator rights could help but didn't try it yet.

                            For now I have no idea what COM object is not found. Something that controls Drag&Drop on the OS level for dragging items between applications I think.

                            Upd: the problem must be somewhere in the following module
                            https://code.woboq.org/qt5/qtbase/src/plugins/platforms/windows/qwindowsdrag.cpp.html

                            R 1 Reply Last reply 30 Sept 2021, 16:41
                            1
                            • V Vladimir Orlov
                              21 Sept 2021, 20:49

                              The same problem. Qt 5.15.2, Qt Creator 5.0.1, VS2019 16.11.3, x86 app on x64 Windows. An interesting thing is that it reproduces in Win10 but in Win8.1 all works well.

                              I've read somewhere that running an app with Administrator rights could help but didn't try it yet.

                              For now I have no idea what COM object is not found. Something that controls Drag&Drop on the OS level for dragging items between applications I think.

                              Upd: the problem must be somewhere in the following module
                              https://code.woboq.org/qt5/qtbase/src/plugins/platforms/windows/qwindowsdrag.cpp.html

                              R Offline
                              R Offline
                              rtavakko
                              wrote on 30 Sept 2021, 16:41 last edited by
                              #14

                              @Vladimir-Orlov Running as admin didn't work for me. I have a feeling somehow the drag & drop flag is being set to DROPEFFECT_NONE in the module

                              1 Reply Last reply
                              0
                              • J Offline
                                J Offline
                                jazzco2
                                wrote on 13 Oct 2021, 08:12 last edited by
                                #15

                                When I google for "onecore\com\combase\dcomrem\resolver.cxx(2299)\combase.dll" I get a link to a forum of juce.com describing the same issue. As far as I saw it doesn't seem to be based on Qt. Thus I guess the error happens inside of the Windows libraries itself.

                                R 1 Reply Last reply 13 Oct 2021, 23:41
                                0
                                • J jazzco2
                                  13 Oct 2021, 08:12

                                  When I google for "onecore\com\combase\dcomrem\resolver.cxx(2299)\combase.dll" I get a link to a forum of juce.com describing the same issue. As far as I saw it doesn't seem to be based on Qt. Thus I guess the error happens inside of the Windows libraries itself.

                                  R Offline
                                  R Offline
                                  rtavakko
                                  wrote on 13 Oct 2021, 23:41 last edited by rtavakko
                                  #16

                                  @jazzco2 Right, but what's the solution? If an older windows dll fixes things, I could try finding and swapping it

                                  P.S. that thread talks about a different issue. It is a crash not a warning with strange behaviour and there is no solution there either

                                  1 Reply Last reply
                                  0

                                  • Login

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • Users
                                  • Groups
                                  • Search
                                  • Get Qt Extensions
                                  • Unsolved