How to check if a specific device was connected?
I need to check if a specific USB Printer was connected.
xHarbour 1.2.3 + Fwhh 20.2
How to check if a specific device was connected?
I need to check if a specific USB Printer was connected.
Was connected or still is connected ?
Both works for me.
But know if the device still is connected will provide me a better solution
function isPrinterModel( cModel )
local aPrinters:= getPrinters(), i:=0, lSuccess:=.f.
for i = 1 to len( aPrinters )
if aPrinters[i] = cModel
lSuccess:=.t.
endif
next
return lSuccessJames, the printer isn't recognized as a printer by the OS.
Here in Brazil we have the ECF ( Emissor de Cupom Fiscal ) something like fiscal coupons emitter, thermal printers with a specific firmware that must be used to print valid coupons to collect taxes.
Most of them connect through the serial port, some connect via USB, but create a virtual serial port and a specific brand connects via USB, but creates another type of device (USBIO).
I need to know if this device is connected.
Samir,
OK. Well I don't know the answer to that one.
Here is a manual for setting up USB drivers which may help. Perhaps you can find a registry entry that you could search for.
http://www.thesycon.de/usbio/usbio_win_manual.pdf
And here is a little utility program that will list all the USB devices that have ever been connected. It doesn't solve your problem but maybe it will be useful in finding a solution.
http://www.nirsoft.net/utils/usb_devices_view.html
James