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. QFileDialog->getOpenFileName() errors in debugger.
Forum Updated to NodeBB v4.3 + New Features

QFileDialog->getOpenFileName() errors in debugger.

Scheduled Pinned Locked Moved Solved General and Desktop
20 Posts 3 Posters 3.4k Views 3 Watching
  • 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.
  • M Offline
    M Offline
    mzimmers
    wrote on 15 Oct 2018, 17:36 last edited by mzimmers
    #1

    Hi all -

    When I run the code below in the debugger:

    QFileDialog *qfd;
    ...
    filename = qfd->getOpenFileName(this,
                                        tr("Open Firmware file"),
                                        pathname,
                                        filter,
                                        &selectedFilter,
                                        QFileDialog::DontUseNativeDialog);
    
    

    Two odd things occur:

    1. I get several instances of this error message:
    onecore\com\combase\catalog\packagedcomcatalog.cpp(1993)\combase.dll!75F6EAD0: (caller: 75FA2BDC) ReturnHr(6) tid(1cec) 80040155 Interface not registered
    
    1. The app needs several seconds to fully render the dialog.

    Neither of these occur when running the app without the debugger.

    Any ideas what I'm doing wrong? Thanks...

    EDIT: the DontUseNativeDialog flag was an attempt to fix this; the behavior's the same with or without it.

    K 1 Reply Last reply 15 Oct 2018, 18:18
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 15 Oct 2018, 17:55 last edited by
      #2

      @mzimmers said in QFileDialog->getOpenFileName() errors in debugger.:

      QFileDialog *qfd;

      Just as a note:
      You do have
      QFileDialog *qfd = new QFileDialog(this)
      some place?

      M 1 Reply Last reply 15 Oct 2018, 17:59
      0
      • M mrjj
        15 Oct 2018, 17:55

        @mzimmers said in QFileDialog->getOpenFileName() errors in debugger.:

        QFileDialog *qfd;

        Just as a note:
        You do have
        QFileDialog *qfd = new QFileDialog(this)
        some place?

        M Offline
        M Offline
        mzimmers
        wrote on 15 Oct 2018, 17:59 last edited by
        #3

        @mrjj Yes, I do. When I post code, I try to include only the relevant stuff. The rest I replace with "..." but I guess unless you're a mind-reader, you wouldn't know that.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 15 Oct 2018, 18:12 last edited by mrjj
          #4

          @mzimmers said in QFileDialog->getOpenFileName() errors in debugger.:

          80040155 Interface not registered

          I have had similar message using visual studio compiler.
          It went away after i repair VS using the option in the installer.
          There can be other reason for this error
          https://stackoverflow.com/questions/44579720/qt-widget-application-library-not-registered-error

          1 Reply Last reply
          1
          • M mzimmers
            15 Oct 2018, 17:36

            Hi all -

            When I run the code below in the debugger:

            QFileDialog *qfd;
            ...
            filename = qfd->getOpenFileName(this,
                                                tr("Open Firmware file"),
                                                pathname,
                                                filter,
                                                &selectedFilter,
                                                QFileDialog::DontUseNativeDialog);
            
            

            Two odd things occur:

            1. I get several instances of this error message:
            onecore\com\combase\catalog\packagedcomcatalog.cpp(1993)\combase.dll!75F6EAD0: (caller: 75FA2BDC) ReturnHr(6) tid(1cec) 80040155 Interface not registered
            
            1. The app needs several seconds to fully render the dialog.

            Neither of these occur when running the app without the debugger.

            Any ideas what I'm doing wrong? Thanks...

            EDIT: the DontUseNativeDialog flag was an attempt to fix this; the behavior's the same with or without it.

            K Offline
            K Offline
            kshegunov
            Moderators
            wrote on 15 Oct 2018, 18:18 last edited by
            #5

            @mzimmers said in QFileDialog->getOpenFileName() errors in debugger.:

            When I run the code below in the debugger

            Why are you calling a static function like an object method to begin with?

            Read and abide by the Qt Code of Conduct

            M 1 Reply Last reply 15 Oct 2018, 18:20
            3
            • K kshegunov
              15 Oct 2018, 18:18

              @mzimmers said in QFileDialog->getOpenFileName() errors in debugger.:

              When I run the code below in the debugger

              Why are you calling a static function like an object method to begin with?

              M Offline
              M Offline
              mzimmers
              wrote on 15 Oct 2018, 18:20 last edited by
              #6

              @kshegunov said in QFileDialog->getOpenFileName() errors in debugger.:

              @mzimmers said in QFileDialog->getOpenFileName() errors in debugger.:

              When I run the code below in the debugger

              Why are you calling a static function like an object method to begin with?

              I'm not sure I understand your question; what should I be doing differently?

              M K 2 Replies Last reply 15 Oct 2018, 18:23
              0
              • M mzimmers
                15 Oct 2018, 18:20

                @kshegunov said in QFileDialog->getOpenFileName() errors in debugger.:

                @mzimmers said in QFileDialog->getOpenFileName() errors in debugger.:

                When I run the code below in the debugger

                Why are you calling a static function like an object method to begin with?

                I'm not sure I understand your question; what should I be doing differently?

                M Offline
                M Offline
                mrjj
                Lifetime Qt Champion
                wrote on 15 Oct 2018, 18:23 last edited by
                #7

                @mzimmers
                Hi, the function is static, meaning it call be called WITHOUT an object instance ( qfd in this case )
                alt text

                notice the syntax in sample.

                1 Reply Last reply
                2
                • M mzimmers
                  15 Oct 2018, 18:20

                  @kshegunov said in QFileDialog->getOpenFileName() errors in debugger.:

                  @mzimmers said in QFileDialog->getOpenFileName() errors in debugger.:

                  When I run the code below in the debugger

                  Why are you calling a static function like an object method to begin with?

                  I'm not sure I understand your question; what should I be doing differently?

                  K Offline
                  K Offline
                  kshegunov
                  Moderators
                  wrote on 15 Oct 2018, 18:24 last edited by kshegunov
                  #8

                  Well, the thing is that qfd has no meaning in your case. QFileDialog::getOpenFileName is a static function, thus it neither requires nor it takes into account any object of type QFileDialog. What you ordinarily do is just call it as a regular function:

                  QString filename = QFileDialog::getOpenFileName( .... )
                  

                  PS.

                  <rant>
                  I has annoyed me for ages that in the Qt docs you see the following application skeleton:

                  int main(int argc, char *argv[])
                  {
                      QApplication app(argc, argv);
                      return app.exec();
                  }
                  

                  It is misleading! QCoreApplication::exec is a static function!
                  </rant>

                  Read and abide by the Qt Code of Conduct

                  1 Reply Last reply
                  1
                  • M Offline
                    M Offline
                    mzimmers
                    wrote on 15 Oct 2018, 18:28 last edited by
                    #9

                    OK, thanks for the explanation. I changed it per your example -- behavior is unchanged.

                    K M 2 Replies Last reply 15 Oct 2018, 18:32
                    0
                    • M mzimmers
                      15 Oct 2018, 18:28

                      OK, thanks for the explanation. I changed it per your example -- behavior is unchanged.

                      K Offline
                      K Offline
                      kshegunov
                      Moderators
                      wrote on 15 Oct 2018, 18:32 last edited by
                      #10

                      I imagine so, it's just an oddity. The point was you understand that whatever you do to the object has no bearing on the QFileDialog::getOpenFileName.

                      My first advice would've been to try the Qt dialog, but apparently that's not the problem. Second thing that comes to mind is to try the regular way of opening the dialog, i.e. using show on an initialized object. Third thing you could try is to disable the side pane of the dialog (I'm too lazy to check the docs for the correct flag, but I'm sure you can manage that).

                      Read and abide by the Qt Code of Conduct

                      M 1 Reply Last reply 22 Oct 2018, 14:25
                      1
                      • M mzimmers
                        15 Oct 2018, 18:28

                        OK, thanks for the explanation. I changed it per your example -- behavior is unchanged.

                        M Offline
                        M Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on 15 Oct 2018, 18:34 last edited by
                        #11

                        @mzimmers
                        Just to know.
                        Which compiler are you using ?

                        M 1 Reply Last reply 15 Oct 2018, 20:26
                        0
                        • M mrjj
                          15 Oct 2018, 18:34

                          @mzimmers
                          Just to know.
                          Which compiler are you using ?

                          M Offline
                          M Offline
                          mzimmers
                          wrote on 15 Oct 2018, 20:26 last edited by
                          #12

                          @mrjj MinGW5.3.0 32bit for C++

                          M 1 Reply Last reply 15 Oct 2018, 20:28
                          0
                          • M mzimmers
                            15 Oct 2018, 20:26

                            @mrjj MinGW5.3.0 32bit for C++

                            M Offline
                            M Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on 15 Oct 2018, 20:28 last edited by
                            #13

                            @mzimmers
                            ok, just the one that comes with Qt ?
                            Could you try a clean default GUI project and just a pushbutton with
                            QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"),
                            "/home",
                            tr("Images (*.png *.xpm *.jpg)"));
                            to see if it always says it or it somehow is related to your code ?

                            M 1 Reply Last reply 15 Oct 2018, 20:39
                            1
                            • M mrjj
                              15 Oct 2018, 20:28

                              @mzimmers
                              ok, just the one that comes with Qt ?
                              Could you try a clean default GUI project and just a pushbutton with
                              QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"),
                              "/home",
                              tr("Images (*.png *.xpm *.jpg)"));
                              to see if it always says it or it somehow is related to your code ?

                              M Offline
                              M Offline
                              mzimmers
                              wrote on 15 Oct 2018, 20:39 last edited by
                              #14

                              @mrjj

                              Got this:

                              onecoreuap\shell\windows.storage\sharedstoragesources\util.cpp(2831)\windows.storage.dll!764FCA21: (caller: 7655AA74) ReturnHr(1) tid(2fc8) 80070490 Element not found.
                                  CallContext:[\CAutoDestItemsEnum::Next\CAutoDestItemsEnum::_EnsureInit] 
                              onecoreuap\shell\windows.storage\homefolder.cpp(504)\windows.storage.dll!768C5FE8: (caller: 76603224) ReturnHr(2) tid(2fc8) 80004002 No such interface supported
                              onecoreuap\shell\windows.storage\kfapi\folderpathidlistcache.cpp(208)\windows.storage.dll!764809CC: (caller: 7647FC1C) LogHr(1) tid(2198) 80070002 The system cannot find the file specified.
                              

                              The LogHr message repeated 64 times.

                              K 1 Reply Last reply 15 Oct 2018, 20:47
                              0
                              • M mzimmers
                                15 Oct 2018, 20:39

                                @mrjj

                                Got this:

                                onecoreuap\shell\windows.storage\sharedstoragesources\util.cpp(2831)\windows.storage.dll!764FCA21: (caller: 7655AA74) ReturnHr(1) tid(2fc8) 80070490 Element not found.
                                    CallContext:[\CAutoDestItemsEnum::Next\CAutoDestItemsEnum::_EnsureInit] 
                                onecoreuap\shell\windows.storage\homefolder.cpp(504)\windows.storage.dll!768C5FE8: (caller: 76603224) ReturnHr(2) tid(2fc8) 80004002 No such interface supported
                                onecoreuap\shell\windows.storage\kfapi\folderpathidlistcache.cpp(208)\windows.storage.dll!764809CC: (caller: 7647FC1C) LogHr(1) tid(2198) 80070002 The system cannot find the file specified.
                                

                                The LogHr message repeated 64 times.

                                K Offline
                                K Offline
                                kshegunov
                                Moderators
                                wrote on 15 Oct 2018, 20:47 last edited by
                                #15

                                How did you install Qt?

                                Look also at QTBUG-67711 and QTBUG-63789. Probably what you're hitting.

                                Read and abide by the Qt Code of Conduct

                                M 1 Reply Last reply 15 Oct 2018, 21:03
                                4
                                • K kshegunov
                                  15 Oct 2018, 20:47

                                  How did you install Qt?

                                  Look also at QTBUG-67711 and QTBUG-63789. Probably what you're hitting.

                                  M Offline
                                  M Offline
                                  mzimmers
                                  wrote on 15 Oct 2018, 21:03 last edited by
                                  #16

                                  @kshegunov: very interesting. I probably installed Qt via the maintenance tool, though I'm not 100% sure. I don't mind removing and re-installing, but would you suggest using the maintenance tool, or just downloading from the web site?

                                  K 1 Reply Last reply 15 Oct 2018, 21:11
                                  0
                                  • M mzimmers
                                    15 Oct 2018, 21:03

                                    @kshegunov: very interesting. I probably installed Qt via the maintenance tool, though I'm not 100% sure. I don't mind removing and re-installing, but would you suggest using the maintenance tool, or just downloading from the web site?

                                    K Offline
                                    K Offline
                                    kshegunov
                                    Moderators
                                    wrote on 15 Oct 2018, 21:11 last edited by
                                    #17

                                    Actually I would've suggested trying building the library yourself. I'm not sure if you're going to get enough bang for the buck though, even if it helps at all; building Qt on windows is somewhat finicky ...

                                    Read and abide by the Qt Code of Conduct

                                    1 Reply Last reply
                                    1
                                    • M Offline
                                      M Offline
                                      mzimmers
                                      wrote on 15 Oct 2018, 21:27 last edited by
                                      #18

                                      Yeah, I think I'll just live with it until it gets shaken out. My primary concern was that I was doing something wrong; if it's a library mismatch, I can ignore the symptoms, especially since they don't occur outside of the debugger.

                                      Thanks, all.

                                      1 Reply Last reply
                                      3
                                      • K kshegunov
                                        15 Oct 2018, 18:32

                                        I imagine so, it's just an oddity. The point was you understand that whatever you do to the object has no bearing on the QFileDialog::getOpenFileName.

                                        My first advice would've been to try the Qt dialog, but apparently that's not the problem. Second thing that comes to mind is to try the regular way of opening the dialog, i.e. using show on an initialized object. Third thing you could try is to disable the side pane of the dialog (I'm too lazy to check the docs for the correct flag, but I'm sure you can manage that).

                                        M Offline
                                        M Offline
                                        mzimmers
                                        wrote on 22 Oct 2018, 14:25 last edited by
                                        #19

                                        @kshegunov said in QFileDialog->getOpenFileName() errors in debugger.:

                                        Second thing that comes to mind is to try the regular way of opening the dialog, i.e. using show on an initialized object.

                                        What did you mean by this? I'm ready to try something new.

                                        K 1 Reply Last reply 22 Oct 2018, 19:13
                                        0
                                        • M mzimmers
                                          22 Oct 2018, 14:25

                                          @kshegunov said in QFileDialog->getOpenFileName() errors in debugger.:

                                          Second thing that comes to mind is to try the regular way of opening the dialog, i.e. using show on an initialized object.

                                          What did you mean by this? I'm ready to try something new.

                                          K Offline
                                          K Offline
                                          kshegunov
                                          Moderators
                                          wrote on 22 Oct 2018, 19:13 last edited by
                                          #20

                                          @mzimmers said in QFileDialog->getOpenFileName() errors in debugger.:

                                          What did you mean by this? I'm ready to try something new.

                                          QFileDialog * dialog = new QFileDialog(this);
                                          dialog->setNameFilters(...);
                                          // ... more ...
                                          dialog->show();
                                          

                                          Read and abide by the Qt Code of Conduct

                                          1 Reply Last reply
                                          1

                                          1/20

                                          15 Oct 2018, 17:36

                                          • Login

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