Link to home
Start Free TrialLog in
Avatar of lomo74
lomo74Flag for Italy

asked on

who's holding my serial port?

Hello Experts --
I'm facing an odd problem, I developed a software that communicates with a device on RS232; recently I installed this software on a (nearly) fresh Windows 7 machine and it is giving problems: call to CreateFile to open com port fails with error 5 (access denied).
Since I can reproduce this behaviour on another machine (that normally works) by launching my app twice (the first instance starts, the second one obviously complains), I guess that the error on the Win 7 box is caused by some software that's locking the com port before my software opens it. Maybe a virus scanner or the like?
Can you suggest an utility which tells me "which process is holding COM1, if any"?
I want to: (1) verify that my feeling is correct, then (2) remove the offending process, if any.
thanks, - Lorenzo -
ASKER CERTIFIED SOLUTION
Avatar of bhartwell
bhartwell

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of johnb6767
Avatar of Den_HBR
Den_HBR

Did you try to launch your app as administrator? It could be the UAC who is giving troubles.

And another hint.
I have had this problem in the past. It turned out it was a receiptprinter I had quickly installed to test something and I had forgotten to remove it afterwards.
Avatar of lomo74

ASKER

yes, I tried to run as Administrator but had no luck.
furthermore, my app is UAC-aware (my development machine is itself a Win7 box with UAC enabled), so my app should run as regular user. I have at least two installations out there on Win7 boxes, running flawlessly.

the idea about the printer is good, I didn't think at it! thank you.
I'll test as soon as possible, I don't have the troublesome machine here right now.

thanks go to bhartwell too: great piece of software.

johnb6767: will test portmon too, even if I tried on my dev machine and it shows up blank... don't know if it is due to my serial port being a virtual port (actually, a barcode reader from Datalogic in RS232 emulation)...
Avatar of lomo74

ASKER

just to inform the question is not abandoned --
I'm testing all the stuff in a few days --
Avatar of lomo74

ASKER

Solved! The offending component was a touchscreen driver from 3M. I installed the complete driver set, including drivers for serial touchscreens.
The driver was opening the serial port, searching for its hardware - but there was a barcode scanner there...
ProcessExplorer helped a lot. Thank you.