Results 1 to 7 of 7

Thread: How to use WinUSB in Qt?

  1. #1
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default How to use WinUSB in Qt?

    Good evening, for all!

    I have a problem and I can not solve ...
    I need communication the PC with PIC using USB ....
    Then, I have to create a software in Qt, my plataform is Windows ...
    I study with the book USB Complete, and I searched on the net...
    In my application, which is a kind of data acquisition in real time, I need a fast communication and erros checking...
    In this case I think the right option is Bulk Communication ...
    But in my searches I always arrive at the same point...
    Using WinUSB to create a driver and a DLL, and import functions from the DLL ..
    I saw several examples using VB, VC+ + and VC#...
    But with Qt I can't do it because I don't know and I think it's impossible import DLL functions ...
    The only exemple I found in the net with Qt, is a HID communication ...

    I need someone give me an idea of how to do this...
    If it's possible to create the DLL functions inside the Qt code...
    And, if it's possible, where I find them for I see and implement them in my code!


    Thanks all!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to use WinUSB in Qt?

    This has nothing to do with Qt. Qt is not a compiler or linker.

    You cannot use raw C++ objects in DLLs unless your compiler matches the compiler used to create the original DLL.
    You can use C functions and structures in foreign DLLs.
    You can use objects defined in ActiveX DLLs using generic Windows programming or Active Qt.

    Given that WinUSB follows the usual Windows API conventions this task should be no more difficult than including the relevant header file and linking the relevant library.

  3. #3
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to use WinUSB in Qt?

    Hi....

    I don't understand everything you said...
    But I think you wanted say that it's possible create a program without a DLL...
    Using only the library functions....

    But I don't know how and where I find the library...
    Because in my searches I always find the program with a DLL...

    Can you or anyone help me??

    Thanks All!

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to use WinUSB in Qt?

    Quote Originally Posted by oiluj View Post
    But I think you wanted say that it's possible create a program without a DLL...
    No. I said nothing like that. I gave you the generic answer to mixing libraries built in different ways and with different compilers.
    The WinUSB library functions are in the winusb.dll file that is part of Microsoft Windows Driver Kit (WDK).
    Using only the library functions....
    Yes
    But I don't know how and where I find the library...
    It is part of Microsoft Windows Driver Kit (WDK) according to http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
    Because in my searches I always find the program with a DLL...
    That is because WinUSB's user functions are delivered in a DLL.

    Do you ultimately want to write a custom USB driver or are you trying to talk to a device that falls into one of the standard classes?
    Have you looked at libusb?

  5. #5
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to use WinUSB in Qt?

    Hi!! And Sorry for my bad english and my bad understanding...

    I want comunicate the PC with my device...
    My device is a data acquisition system controled for PIC microcontroler...
    And I need a fast comunication and errors checking...
    From this I think it's best to me is Bulk!!
    But bulk needs a driver, so I use WinUSB...

    And how is a project of my university, and the teacher doesn't want me to use libraries like libusb...
    I think the only way is the WinUSB!

    And I read the link if you send to me...
    In this link has all the functions...
    But, it's in C++??

    And the header file is created automatically when I use WinUSB??

    Thank's a lot!

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to use WinUSB in Qt?

    The header files, library files and documentation should be in the Microsoft Windows Driver Kit (WDK). These should work without problems when using the Microsoft compiler.

    If you are using the MingW compiler you will probably have issues with the headers using things not present in MingW. You should be able to use the library if you can get past any header issues.

    The functions in the WinUSB library are like all the Windows API: they are accessible from C++.

    I cannot help with actually using the WinUSB library. From what I gather it is not for the faint hearted, which I why I suggested libusb.

  7. #7
    Join Date
    Oct 2011
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to use WinUSB in Qt?

    Hello...

    Thanks for all help...

    And if is not abuse....
    I read the link of Microsoft about de WinUSB, and I found a piece that talk about the import libraries...
    And I saw the example code of the site, and in example there isn't DLL imports....
    And I saw too the example I found in the net... And the functions that are imported in the example are the same in the example of the site...

    And I think if I just include the libraries, I can use its functions...
    And I think which I need modify the libraries too..

    What are you think about this??

    Thanks a lot!

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.