I use serialex to create object com, but to the start of my program the COM2 has already opened from another application, for this I have to close it before.
I can't use "Serial.PortOpen = False" to close it if I don't create the object serialex before. But this is not possible with the function Serial.NewX(.....) because already open and an error is verified.
I can't use "Serial.PortOpen = False" to close it if I don't create the object serialex before. But this is not possible with the function Serial.NewX(.....) because already open and an error is verified.
In a sense you shouldn't be able to interfere with another program's use of a system resource; that's IT anarchy!
On the other hand if there is a way, I'd use it! I have Navigon-5 on my PPC. If when I close that program and fail to leave several seconds before powering-down, the GPS stays allocated and no program (including a re-started Navigon-5) can use it. The only cure is soft-reset. Or killng what I assume is a hidden thread that stays as a zombie (it's not on the running-program list).