dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: USB Programming with MFC

  1. #1
    Join Date
    Jan 2012
    Location
    India
    Posts
    193

    USB Programming with MFC

    Hi ..

    I need data transfer through USB port . Pl guide me how to program USB port via MFC .
    I need tutorial or sample code

    Thanking you

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,581

    Re: USB Programming with MFC

    MFC does not have classes to work with USB ports.
    Usually USB ports are emulated as the serial ports. In such a case you could use one of existing third party classes for serial ports:
    http://www.codeguru.com/cpp/i-n/netw...erial-port.htm
    http://flounder.com/serial.htm
    https://www.google.ch/url?sa=t&rct=j...03073922,d.d2s
    ...
    If you want to work with USB directly - you will need to write drivers...
    Victor Nijegorodov

  3. #3
    Join Date
    Jan 2012
    Location
    India
    Posts
    193

    Re: USB Programming with MFC

    Thank you VictorN Sir ..

    I will study the links .. I was not well so late reply ..

    but really thank you

  4. #4
    Join Date
    Mar 2001
    Posts
    2,527

    Re: USB Programming with MFC

    ahoodin
    To keep the plot moving, that's why.

  5. #5
    Join Date
    Jan 2012
    Location
    India
    Posts
    193

    Re: USB Programming with MFC

    Hi .. I am reading about WinUSB but my software is compiled on Visual Studio 6.
    I am not pretty sure that VC6.0 will support WinUSB or not ?

    Really thanks Ahoodin Sir

  6. #6
    Join Date
    Mar 2001
    Posts
    2,527

    Re: USB Programming with MFC

    Hey you don't have to call me sir. I'm just like you, I have just been doing it a little while longer.

    Alright, quoting the WinUSB link contained in the link I gave you:
    WinUSB architecture consists of a kernel-mode driver (Winusb.sys) and a user-mode dynamic link library (Winusb.dll) that exposes WinUSB functions. By using these functions, you can manage USB devices with user-mode software.
    You should be able to link the dll to your program with VC6.0 and use its functionality.

    Also:
    WinUSB functions require Windows XP or later. You can use these functions in your C/C++ application to communicate with your USB device. Microsoft does not provide a managed API for WinUSB.
    I suggest you take some time to read the information over and understand it. Read the information, digest it, let it roll around in your head....search google a little to clarify things.

    Oh BTW WinUSB is an API, so technically its not MFC. You can still use it. Enjoy
    Last edited by ahoodin; September 24th, 2015 at 03:08 PM. Reason: add note
    ahoodin
    To keep the plot moving, that's why.

  7. #7
    Join Date
    Jan 2012
    Location
    India
    Posts
    193

    Re: USB Programming with MFC

    ahoodin thanks .....

  8. #8
    Join Date
    Mar 2001
    Posts
    2,527

    Re: USB Programming with MFC

    Welcome. Happy coding!
    ahoodin
    To keep the plot moving, that's why.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)