I'm developing VB6 application that will do printing job via Intermec label printer using serial port.
I'm using MSComm and it works great.
But, whenever i restart my PC, my application would prompt
Run time error 8015
-Could not set comm state, there maybe one or more invalid communications parameters.
I have found that the problem is coming from this
MSComm1.PortOpen = True
I can bypass the error using error handling but it didn't help anything.
It seemed that my printer has got control of the port because it's using the same port.
My only solution is go to the device manager disable and enable the port then it works fine again.
But is there any alternatives way that we can control it from the code itself as my client thinks that it would be tedious job having to disable and enable port all the time when pc is restarted.
Any help would be greatly appreciated.
Thanks a lot.