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. GPIB in QT
Qt 6.11 is out! See what's new in the release blog

GPIB in QT

Scheduled Pinned Locked Moved General and Desktop
26 Posts 6 Posters 16.8k Views 1 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.
  • D Offline
    D Offline
    dbzhang800
    wrote on last edited by
    #12

    Yes, native code is compiled to work directly with the OS, which is not managed by the CLR (Common Language Runtime).

    1 Reply Last reply
    0
    • I Offline
      I Offline
      Ivan1120
      wrote on last edited by
      #13

      http://en.wikipedia.org/wiki/Managed_code
      Look above link, C++ also can be manage code, so C++ can be managed code(C++ in .net) and unmanaged code(Native C++), right !? It depends on which environment developer to use.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dbzhang800
        wrote on last edited by
        #14

        [quote author="Ivan1120" date="1374561273"]http://en.wikipedia.org/wiki/Managed_code
        Look above link, C++ also can be manage code, so C++ can be managed code(C++ in .net) and unmanaged code(Native C++), right !? It depends on which environment developer to use. [/quote]

        Yes, it is depending the options you passed to the msvc c++ compiler. take a simple c++ application for example:

        @
        #include <iostream>

        int main()
        {
        std::cout<<"Hello From MSVC"<<std::endl;
        return 0;
        }
        @

        It can be compiled as native code

        @
        cl a.cpp
        @

        or compiled as managed code

        @
        cl /clr a.cpp
        @

        But in Qt world, only native C++ code make sense at present.


        BTW, you should use the native c/c++ api provided by your device manipulater

        1 Reply Last reply
        0
        • I Offline
          I Offline
          Ivan1120
          wrote on last edited by
          #15

          I have one more question, I tried the direction you gave me from below link:

          http://support.microsoft.com/kb/828736

          In the article, the step 9 of "Call the Managed DLL from Native C++ Code",
          @// Initialize COM.
          HRESULT hr = CoInitialize(NULL);

          // Create the interface pointer.
          ICalculatorPtr pICalc(__uuidof(ManagedClass));

          long lResult = 0;

          // Call the Add method.
          pICalc->Add(5, 10, &lResult);

          wprintf(L"The result is %d", lResult);

          // Uninitialize COM.
          CoUninitialize();
          return 0;@
          What is "ICalculatorPtr"?? The .dll I built from above link, ICalculator is interface, my question is if I want to use .dll from device manufacturer provided, their .dll file should be written from interface ??

          1 Reply Last reply
          0
          • I Offline
            I Offline
            Ivan1120
            wrote on last edited by
            #16

            Does anybody know!?

            1 Reply Last reply
            0
            • JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #17

              Try http://social.msdn.microsoft.com/Forums/vstudio/en-US/217608ea-e499-458a-af36-2dcffd36b323/microsoft-howto-does-not-work-how-to-call-a-managed-dll-from-native-visual-c-code-in-visual

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              0
              • I Offline
                I Offline
                Ivan1120
                wrote on last edited by
                #18

                Thanks, my code can work well.But I want to know what is “ICalculatorPtr”, I didn't see any definition of it. Because if I use this method in the future, this would be a important issue. Thanks in advance.

                1 Reply Last reply
                0
                • JKSHJ Offline
                  JKSHJ Offline
                  JKSH
                  Moderators
                  wrote on last edited by
                  #19

                  I've never seen it myself, sorry. Try asking at a Microsoft forum, since it's from Microsoft API.

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  1 Reply Last reply
                  0
                  • I Offline
                    I Offline
                    Ivan1120
                    wrote on last edited by
                    #20

                    Thank you:)). If I can't get answer here, maybe I'll go to ask in Microsoft forum.Does any body know what is “ICalculatorPtr” and how does it generate??

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      dbzhang800
                      wrote on last edited by
                      #21

                      [quote author="Ivan1120" date="1374589946"]Thanks, my code can work well.But I want to know what is “ICalculatorPtr”, I didn't see any definition of it. Because if I use this method in the future, this would be a important issue. Thanks in advance.[/quote]

                      It's a typedef of smart pointer _com_ptr_t

                      http://msdn.microsoft.com/en-us/library/8etzzkb6(v=vs.71).aspx

                      1 Reply Last reply
                      0
                      • I Offline
                        I Offline
                        Ivan1120
                        wrote on last edited by
                        #22

                        Thanks:)), Something I'm confused still, according to released document from Microsoft , if I want to use .dll file with managed code in native c++ environment, like "QT", does class in the .dll should be designed to inherit "Interface"?? like following link.

                        http://support.microsoft.com/kb/828736/en-us

                        1 Reply Last reply
                        0
                        • I Offline
                          I Offline
                          Ivan1120
                          wrote on last edited by
                          #23

                          Hi, everyone. Does anybody know above question!?

                          1 Reply Last reply
                          0
                          • JKSHJ Offline
                            JKSHJ Offline
                            JKSH
                            Moderators
                            wrote on last edited by
                            #24

                            [quote author="Ivan1120" date="1374801537"]Hi, everyone. Does anybody know above question!?[/quote]This is a Qt forum, so not everyone here has experience with the .NET framework (some people here don't even use Windows). Try asking at a Microsoft forum.

                            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                            1 Reply Last reply
                            0
                            • I Offline
                              I Offline
                              Ivan1120
                              wrote on last edited by
                              #25

                              I see, thank you.

                              1 Reply Last reply
                              0
                              • O Offline
                                O Offline
                                overtheocean
                                wrote on last edited by
                                #26

                                I developed a set of library/ driver to communicate with Spectrum analyzer, dc supplier, PNA thru GPIB or USB using only Qt.

                                works very well, use it from a main program using .dll

                                M.

                                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