Results 1 to 3 of 3

Thread: QT conmunication with a USB device

  1. #1
    Join Date
    Jul 2015
    Posts
    7
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Red face QT conmunication with a USB device

    HI ,guys
    I get job last week;the Manager want me to transplant a vc6 project into Qt;
    I got all the codes;
    but here is a question I come across:
    in vc6 we can send a control message to a usb device by function "DeviceIoControl" in MSDN:
    DeviceIoControl
    The DeviceIoControl function sends a control code directly to a specified device driver, causing the corresponding device to perform the corresponding operation.

    BOOL DeviceIoControl(
    HANDLE hDevice, // handle to device
    DWORD dwIoControlCode, // operation
    LPVOID lpInBuffer, // input data buffer
    DWORD nInBufferSize, // size of input data buffer
    LPVOID lpOutBuffer, // output data buffer
    DWORD nOutBufferSize, // size of output data buffer
    LPDWORD lpBytesReturned, // byte count
    LPOVERLAPPED lpOverlapped // overlapped information
    );
    I found this funcjtion in the vc project .but for a Qt project how to write/read datas into a USB device?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QT conmunication with a USB device

    There is no difference.

    That is the system's C API, it should be available in a C++ program no matter if it is using Qt or some other C++ based framework.

    Cheers,
    _

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QT conmunication with a USB device

    You just have to make sure you include the same header files and link to the same libraries for these functions in your Qt project.

Similar Threads

  1. HID USB device detection
    By A9am in forum Qt Programming
    Replies: 1
    Last Post: 23rd April 2014, 12:56
  2. Qt - How can know if an IP is being used by a device?
    By guidupas in forum Qt Programming
    Replies: 1
    Last Post: 12th February 2014, 12:59
  3. s60 device (5800,x6)
    By kumari arpita in forum Newbie
    Replies: 0
    Last Post: 3rd September 2012, 09:57
  4. Communicating with a USB device in Qt?
    By N3wb in forum Qt Programming
    Replies: 7
    Last Post: 3rd May 2011, 10:30
  5. Handheld Device
    By freelyfallers in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2007, 12:48

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.