USB

Anyone have suggestions on good sites/books on accessing the usb port from
Windows application? Would like to access a usb port as a serial or parallel
port.

Thanks


0
MAO
11/19/2004 7:48:21 AM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
703 Views

Similar Articles

[PageSpeed] 21

Normally you access the USB port via the device driver for the specific
device which is attached to that port (unless, of course, you are writing
the device driver for a new device).  I'm not sure that it's meaningful to
attempt to" access a usb port as a serial or parallel port" without
knowledge of the device you are trying to communicate with.

Keith



0
11/19/2004 10:11:15 AM
Is it possible to have a USB to rs232 device attached to the computer and
how would I connect?
Is there a specification that defines some common device rules? ie
CreateFile() can open COM1,COM2,LPT1...etc.
Is there some API that can request what a usb device is?
Thanks

"Keith Sheppard" <keith.sheppard@tesco.net> wrote in message
news:uxH9gBizEHA.1292@TK2MSFTNGP10.phx.gbl...
> Normally you access the USB port via the device driver for the specific
> device which is attached to that port (unless, of course, you are writing
> the device driver for a new device).  I'm not sure that it's meaningful to
> attempt to" access a usb port as a serial or parallel port" without
> knowledge of the device you are trying to communicate with.
>
> Keith
>
>
>


0
mao
11/19/2004 12:46:32 PM
mao wrote:

> Is it possible to have a USB to rs232 device attached to the computer and
> how would I connect?
> Is there a specification that defines some common device rules? ie
> CreateFile() can open COM1,COM2,LPT1...etc.
> Is there some API that can request what a usb device is?
> Thanks
> 

Yes, there are several commercial USB-to-RS232 adapter devices.  They 
come with a device driver that must be installed.  The device driver 
will permit you to access the RS-232 port with CreateFile("COMx"....), 
as if it was a COM port.

-- 
Scott McPhillips [VC++ MVP]

0
Scott
11/19/2004 12:50:50 PM
Sorry but I'm still learning...We have a usb to parallel cable that is
plugged into XP. The properties dialog of a print driver shows the port as a
USB01 device. I guess I am trying to learn how to check the available ports
and hopefully use CreateFile to open the port for communications. I already
use CreateFile for rs232 and parallel communications...I just don't know how
(if possible) to connect to a usb port. I appreciate and help or links.


"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message
news:e3yOObjzEHA.3376@TK2MSFTNGP12.phx.gbl...
> mao wrote:
>
> > Is it possible to have a USB to rs232 device attached to the computer
and
> > how would I connect?
> > Is there a specification that defines some common device rules? ie
> > CreateFile() can open COM1,COM2,LPT1...etc.
> > Is there some API that can request what a usb device is?
> > Thanks
> >
>
> Yes, there are several commercial USB-to-RS232 adapter devices.  They
> come with a device driver that must be installed.  The device driver
> will permit you to access the RS-232 port with CreateFile("COMx"....),
> as if it was a COM port.
>
> -- 
> Scott McPhillips [VC++ MVP]
>


0
mao
11/19/2004 6:05:34 PM
Nevermind, I think I've figured it out...EnumPorts();
Thanks
"mao" <NoSpam> wrote in message
news:ekNWdJmzEHA.3376@TK2MSFTNGP12.phx.gbl...
> Sorry but I'm still learning...We have a usb to parallel cable that is
> plugged into XP. The properties dialog of a print driver shows the port as
a
> USB01 device. I guess I am trying to learn how to check the available
ports
> and hopefully use CreateFile to open the port for communications. I
already
> use CreateFile for rs232 and parallel communications...I just don't know
how
> (if possible) to connect to a usb port. I appreciate and help or links.
>
>
> "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message
> news:e3yOObjzEHA.3376@TK2MSFTNGP12.phx.gbl...
> > mao wrote:
> >
> > > Is it possible to have a USB to rs232 device attached to the computer
> and
> > > how would I connect?
> > > Is there a specification that defines some common device rules? ie
> > > CreateFile() can open COM1,COM2,LPT1...etc.
> > > Is there some API that can request what a usb device is?
> > > Thanks
> > >
> >
> > Yes, there are several commercial USB-to-RS232 adapter devices.  They
> > come with a device driver that must be installed.  The device driver
> > will permit you to access the RS-232 port with CreateFile("COMx"....),
> > as if it was a COM port.
> >
> > -- 
> > Scott McPhillips [VC++ MVP]
> >
>
>


0
mao
11/19/2004 6:39:10 PM
Reply:

Similar Artilces:

Star TSP 700 USB receipt printer
Is anyone using this printer? I tried to use the raster driver and can get it to print a receipt but it doesn't pop the cash drawer. When using the OPOS driver for the printer it only shows COM port choices not USB. The cash drawer does pop if I use a parrallel TSP 743 printer and the OPOS driver. Pat Use USB and go into printer options and under raster it shows cash drawer info "Pat@arms" <Patarms@discussions.microsoft.com> wrote in message news:65B7D22C-34FD-4DC4-928A-7C3B4F952C5C@microsoft.com... > Is anyone using this printer? I tried to use the raster driver...

USB
Anyone have suggestions on good sites/books on accessing the usb port from Windows application? Would like to access a usb port as a serial or parallel port. Thanks Normally you access the USB port via the device driver for the specific device which is attached to that port (unless, of course, you are writing the device driver for a new device). I'm not sure that it's meaningful to attempt to" access a usb port as a serial or parallel port" without knowledge of the device you are trying to communicate with. Keith Is it possible to have a USB to rs232 device attached...

Maintaining Order of Songs Synced from WMP to USB Stick
Hi There, I'm a novice, and I thank you for reading my message. I've been creating Sync Lists of Songs, with the songs mixed in a particular order I desire. I then name the playlist. I sync the lists into my USB Stick 1GB without shuffling, but upon playback the order of the songs in the playlist have been altered. In fact, they are played back in the order of the artist. Is it possible to sync the playlist exactly as I mixed it, and have the USB Stick playback the exact mix of song order accordingly? Or is this an impossiblity? Thank you for your help and...

USB problem
Running XP-SP3 with all updates current. I have a WACOM tablet, driver is latest version; plugged into a USB port in rear of DELL PC. I'll boot up and get error message,"USB device not recognized...". I check Device Manager and no flags are showing. I simply plug into another USB port and I get message that "Human Interface Device found" and my tablet now works. The next day I boot up and the same error message pops up and the fix is to reverse what I did the previous day, just plug back into yesterday's "bad USB port". Any ideas what I am ch...

How do I enable USB ports?
I'm on a computer that was origionally intended for public use but is now used in an office and as a result of being intended for public use, it's set so that nothing connects to the USB ports. If I plug in a drive, it lights up, so there is power to the USB ports, but it doesn't show in My Computer. So how do I enable the USB ports? What icon do I go to in Control Panel? Or, in case that icon isn't there, in what subfolder of Z:\User would I find the file that opens the needed panel? Enter the BIOS and re-enable them. Also see:- http://www.dexternights....

Enumerating USB device
Hi, I have a USB device that has 2 logical units. USBSTOR\DISK&VEN_XXXX&PROD_YYYY&REV_0100\0123456789990&0 (Drive A:) USBSTOR\DISK&VEN_XXXX&PROD_YYYY&REV_0100\0123456789990&1 (Drive B:) I used SetupDiEnumDeviceInterfaces() func and I get just one:USBSTOR\DISK&VEN_XXXX&PROD_YYYY&REV_0100\0123456789990 I guess this is understandable since there is only one physical device. However, is there a function that I can use to get both the drive letters? I used the DEVINTERFACE_VOLUME GUID for the SetupDiEnumDeviceInterfaces() function. ...

Charging an IPod with USB
I'm in China where their electrical supply is 220V. I am using my laptop to charge my stepson's IPod. However, he is sometimes at his father's house where he only has access to a desktop which is using the 220V electrical supply. Does the desktop USB connection supply the same amount of power as my laptop USB connection or will I toast his IPod when using the USB connection on the desktop? In other words, do all USB connections supply the same amount of output power, regardless of the input voltage? Please excuse my ignorance and thank you in advance for any assistan...

Unable to unplug the USB device if I open and close any document from USB device from my application
Hi, I have written a aplication which support specific file format document say .dat file. By using this application I can open \ read \ write the .dat files. But If I open a .dat file which is present in USB device and modify the content of a file and close the file properly then if i try to unplug the USB (without closing my application) then Windows Vista \ XP will not allow to unplug the USB device it says "Windows can's stop your Generic volume device....." message box. To unplug the USB device I have to close my application. Can anyone please tell me why I am u...

Can I still recover a file I saved in USB Flash disk from my HDD?
Can I still recover a file I saved in USB Flash disk from my HDD? Can it still be perhaps somewhere among temporary files? The story is short I saved s file in a USB disk and lost it... forgot to make a backup on my HDD. Do you know how to get down to the command (DOS) prompt on your pc? If you do take the following action:- 1. Go to DOS prompt. 2. Make sure you are at:- C:\> 3. Type in:- dir xxxxxx.xlsx /s - where xxxxxx.xlsx is the name of the file that you have lost. If it is still on your HDD the above command will tell you where it is (which direc...

Re: pst on a usb stick
Yep - that's what I have been doing. It's a minor price to pay for a very powerful capability (IMHO). Maybe I'll have to look into writing some VBA to close open PSTs then exit. Thanks! /SamCal/ Reply-To: "Diane Poremsky [MVP]" <outlookmvp@msn.com> From: "Diane Poremsky [MVP]" <outlookmvp@msn.com> References: <OywwLA5dIHA.2448@TK2MSFTNGP03.phx.gbl> <200851124616scalabrese@comcast.net> Subject: Re: pst on a usb stick Date: Mon, 12 May 2008 07:52:11 -0400 Lines: 49 Organization: Slipstick.com Message-ID: <77311BBA-C06C-42EC-A060-C9...

Kensington PocketHUB Mini USB 2.0 - Hub - 4 ports
List Price:$21.95 Image: http://bestdeallocator.info/image.php?id=B000VMWG9U Best price found: http://bestdeallocator.info/index.php?id=B000VMWG9U The Kensington PocketHUB Mini USB 2.0 is the fastest way to turn one port into four. When you're traveling, your business doesn't stop. Now you can plug in and get four ports to do just about everything - scan, print, use your favorite mouse. Small, compact and lightweight, this is the smartest move you can make. Plug and play that's ready to go anytime, anywhere. ...

How can i prevent xp auto play, when i inject a usb storage?
I want to prvent xp autoplay in vc programmed when a usb storage is injected into machines, how can i do? I know set regedit, can do this , but i want to know any other method, especially in programm. You can do the same thing you would do when you use RegEdit. You can alter the registery using : RegOpenKeyEx(...) RegQueryValueEx(...) RegSetValueEx(...) AliR. "tanyuheng" <tanyuheng@etang.com> wrote in message news:%23uERaFi%23FHA.3036@TK2MSFTNGP09.phx.gbl... > I want to prvent xp autoplay in vc programmed when a usb storage is injected > into machines, how can i...

Disable prompt for USB Driver
We are developing a system with CE 6.0 R2 that has a user accessible USB port. We want the user to be able to plug in flash drives so we can upload and download files. However if the user plugs in a device that is not supported via the built in drivers we get an Unidentified USB Device message box asking the user to enter the name of the driver. Is there a way to disable this prompt and basically have the system ignore the device? Thanks You can clone the USB Host driver and remove the call to CallGetDriverName() or you can clone NETUI and modify GetDriverName() The f...

USB optical mouse
Hello, I have windows xp home installed and it was installed with ps/s mouse and keyboard. I am trying to install a USB optical mouse and I got the error below: A problem has occured during the installation. Your hardware might not work correctly. The USB port is enabled and I usually connect USB stick memory drives and it works fine, but there is a problem with the mouse. Mouse lights up, initializes during Bios routine but somehow windows does not see it. Thank you On Wed, 9 Jun 2010 10:40:44 -0700 (PDT), Tester <calinguga@netscape.net> wrote: >Hello, >I have wi...

USB mass storage device asynchronous file change notification
Hello, A challenge: I have a (RAM) disk, which is exposed as a USB mass storage device. Therefore, the desktop computer accesses my disk as a SCSI block device. Also, I mounted the same disk using the FATFS and I can see files under WinCE, which have been just copied over USB from the desktop. So far, so good. Now: if I create a file under WinCE, the desktop computer does not notice and I can wait forever. When I unplug and plug-in the USB again, I can see the file created before under WinCE. Is there a sort of SCSI asynchronous file change notification? If so, is there any exam...

sample code for USB drivers with interupt transfer type
i am writing usb driver for screen touch monitor , this driver reads the co-ordinate of the point where monitor is touched, transfer type for this usb is Interrupt based . i need a sample (template ) which may help me . i am using DDK to do so suhas <suhas@discussions.microsoft.com> wrote: > >i am writing usb driver for screen touch monitor , this driver reads the >co-ordinate of the point where monitor is touched, transfer type for this usb >is Interrupt based . >i need a sample (template ) which may help me . i am using DDK to do so The RIGHT solut...

so one USB port not equal to other USB port
I have been having trouble with one of my USB hard disks. It worked for some time, but not reliably. In practice it randomly dismounted while copying files (and also when not copying). After that I had to pull the power plug and reinsert it to make the drive mount again. Yesterday this happened again, I got annoyed and, since the drive is still under a few monthes warranty, I decided to call Medion support. This guy advised to try it on another USB port. Initially I was sceptical but nevertheles I gave it a try. Guess what? The troublesome drive now seems to work like a charm! ...

How to sync desktop Exchange mailbox with laptop personal store via USB stick?
Hello, So here's the situation. We have a user with Outlook on their desktop and an Exchange server mailbox. They also have a laptop which for security reasons can *never* be connected to any network. Outlook is also installed on the laptop and they want to sync (in both directions) the desktop server-based mailbox with the laptop personal- store-based mailbox, particularly the Calendar, using a file-based mechanism on a USB memory stick. Anyone recommend a 3rd party solution or a feasible workaround? I can only find PST-to-PST solutions. Best I've come up with is U3-like software. ...

usb 1.0 or usb 2.0?
How can I determine which usb I have? Is there something in Windows which will tell me? Thanks, -- John John wrote: > How can I determine which usb I have? > Is there something in Windows which will tell me? > > Thanks, For the chipset on the computer itself, you can use the method described here. http://www.usbman.com/Guides/checking_for_usb_2.htm When you plug in a peripheral, there is a negotiation of the rate. If you had a bad cable, it is possible the devices would negotiate a lower rate. There is a utility (UVCView) that can dump config informat...

LP2824 USB
anyone have any luck printing with the lp2824 (usb version) with the generic text driver? I have it working fine with the windows drivers and RMS label wizard...but it is not very flexible. I want to print using EPL2, but when i install the generic text driver, and try to print a test script, nothing happens...I see the job enter the print que and then disappear without the printer doing anything. Thanks. Try removing the windows driver and than install the generic text driver. Mihir Diviasoft, Inc mihirs@diviasoft.com(donotspam) 732-791-2894 "Angelo" <Angelo@discussions...

Why Transfer from internal HD to USB External Drive?
I'm trying to transfer about 64G from an internal drive to an external Seagate Free Agent 1.0 terrabyte drive (Subject). The estimated time is about 3.3 hours. That seems very slow. I have no idea if I'm using a USB 2.0 or 1.0 port. I ran Sandra and it showed USB Controller 5, 12419 NEC PIC to USB 2.0. No other USB controller shows any USB version, that is, not 1.0. I have about a six year old ASUSA7S333 MB. How do I know which of the 6 USB ports (four on a card), two in front, is the 2.0 port? Only five USB controllers are listed by Sandra. One of the front ones may n...

wince 6.0 usb suspend
Hi: on wince6.0,I dont know how to send suspend commond to usb device,please help me. my usb device can enter suspend if plug out it from wince 6.0 device Hi. Check device protocol, maybe you need to send specific request. Or you can try to set 0 (zero) configuration. Try lpSuspendDevice (http://msdn.microsoft.com/en-us/library/ee486948.aspx) if meet your need. This is not a public API so you need to issue lpSuspendDevice in the USB class driver. "patrick" <patrick@discussions.microsoft.com> wrote in message news:48B8267B-FA9B-4E89-9626-315C34FE61DC@microsof...

USB Issue with WinXP?
I have a bit of a problem with WinXP telling me that one of my USB devices would operate faster if it was connected to a Hi-Speed USB 2 port. But it does not ID the device in question. How do I figure out which device it is referring to? It does not happen all the time, maybe once or twice a day, so it's hard to pin-point. I've attached screen copies of the messages, if that will help ID the source. Any thoughts are appreciated. Thanks Charliec From: <charliec@email.com> | I have a bit of a problem with WinXP telling me that one of my USB | devices would ope...

How do detect USB device arrive/remove in the HealthVault structur
Hi all, I am using the FabrikamBloodPressure sample to add my own code, but there are some function need to complete (e.g., OnDeviceArrival). I had try and search some solution, but they don't work well or i can't find the place to add in my code (e.g., RegisterDeviceNotification) And where are some other discussion. <a href="http://social.msdn.microsoft.com/Forums/en-US/healthvault/thread/aa7d26ce-a044-401f-bdc4-42d1416e6839">Thread 1</a> <a href="http://social.msdn.microsoft.com/Forums/en/healthvault/thread/a14a1467-dcda-4300-91b9-b0...

GetDriveType .... how to detect a flash USB disk
Hello to all, I try to automatically detect a USB Flah disk plugged on my PC . with the function GetDriveType( ) I can't know which kind of removable drive it is, with the types defined .... : DRIVE_UNKNOWN DRIVE_NO_ROOT_DIR DRIVE_REMOVABLE DRIVE_FIXED DRIVE_REMOTE DRIVE_CDROM DRIVE_RAMDISK Any idea ( I can t do any assumption on the size ) GetVolumeInformation( ) and others functions which return the size in bytes and the number of cluster are not good to do the job ! Is it possible ? ( to detect Flash memory from one hand and to detect the communication ( USB or Firewire IEEE...