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. QNetworkInterface::allInterfaces() produces error messages
Forum Updated to NodeBB v4.3 + New Features

QNetworkInterface::allInterfaces() produces error messages

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 747 Views 2 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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by
    #1

    Hi all -

    This has been going on for awhile, but given that I'm having some other networking issues, I figured it was time to solve this.

    void UdpSocket::sendDiscoveryMsgs()
    {
        QList<QNetworkInterface> qnil;
    
        qnil = QNetworkInterface::allInterfaces();
    ...
    

    Produces this output in the console window:

    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.
    Invalid parameter passed to C runtime function.
    

    Don't know what more I can really say about it...anyone have any ideas?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What version of Qt are you using ?
      On what OS ?

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

      mzimmersM 1 Reply Last reply
      0
      • Christian EhrlicherC Offline
        Christian EhrlicherC Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • SGaistS SGaist

          Hi,

          What version of Qt are you using ?
          On what OS ?

          mzimmersM Offline
          mzimmersM Offline
          mzimmers
          wrote on last edited by mzimmers
          #4

          @sgaist Oh, sorry...Windows 10, and 5.12.3.

          This is part of an earlier exercise that was made necessary because Windoze doesn't let you specify which network interface you want to use, so my Qt app was always finding its way to the wrong interface, and couldn't talk to my target device.

          I get a list of interfaces, and send a message to each one. The one that answers, I presume to be the "correct" interface, and I go from there. Simple in concept, but it's proving to be rather complicated, and not so reliable.

          EDIT:

          A little more information: I upgraded to 5.13.1 (and Creator 4.10) with the same results. BUT: I also noticed it only does it when running in the debugger. Even my debug build, when launched without the debugger, does not produce the above output.

          So...possibly an error in Creator?

          JonBJ 1 Reply Last reply
          0
          • mzimmersM mzimmers

            @sgaist Oh, sorry...Windows 10, and 5.12.3.

            This is part of an earlier exercise that was made necessary because Windoze doesn't let you specify which network interface you want to use, so my Qt app was always finding its way to the wrong interface, and couldn't talk to my target device.

            I get a list of interfaces, and send a message to each one. The one that answers, I presume to be the "correct" interface, and I go from there. Simple in concept, but it's proving to be rather complicated, and not so reliable.

            EDIT:

            A little more information: I upgraded to 5.13.1 (and Creator 4.10) with the same results. BUT: I also noticed it only does it when running in the debugger. Even my debug build, when launched without the debugger, does not produce the above output.

            So...possibly an error in Creator?

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #5

            @mzimmers
            May I ask/suggest something, meaning it to be helpful?

            For this kind of problem and question you have, do you compile Qt yourself and have the sources? If I were developing in C++, I'd hope to run the program from the debugger with all the Qt source and C++ runtime source there. Then you might get stack traces and debug info, be able to break and step, etc. Once set up, I would have thought that might help with all sorts of nasties, or needing to understand?

            mzimmersM 1 Reply Last reply
            2
            • JonBJ JonB

              @mzimmers
              May I ask/suggest something, meaning it to be helpful?

              For this kind of problem and question you have, do you compile Qt yourself and have the sources? If I were developing in C++, I'd hope to run the program from the debugger with all the Qt source and C++ runtime source there. Then you might get stack traces and debug info, be able to break and step, etc. Once set up, I would have thought that might help with all sorts of nasties, or needing to understand?

              mzimmersM Offline
              mzimmersM Offline
              mzimmers
              wrote on last edited by
              #6

              @jonb I could do that. It'll take some time to set up and build, though. Now that I've discovered this problem only manifests when the debugger is running, I'm not as concerned about it, though I wonder whether I should report it as a bug.

              JonBJ 1 Reply Last reply
              0
              • mzimmersM mzimmers

                @jonb I could do that. It'll take some time to set up and build, though. Now that I've discovered this problem only manifests when the debugger is running, I'm not as concerned about it, though I wonder whether I should report it as a bug.

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by JonB
                #7

                @mzimmers
                What I had in mind is there are other deep questions you sometimes have. It's worth it if you can easily re-use the environment all the time, I didn't mean for once-off.

                And, yes, there are occasions where a problem only manifests in the debugger, or not in the debugger, or only when do/don't compile for debug, and that can get infuriating!

                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