Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSComm object problem

Status
Not open for further replies.

aliinal

Technical User
Jun 26, 2001
104
TR
In my code i check whether com port is open and if it's not then i open it.

If mscomm1.portopen = true then '1
mscomm1.portopen = false '2
end if '3

mscomm1.portopen = true '4

my code goes like this
but sometimes in line1, mscomm1.portopen returns false so if consition does not run (line2). But in line 4 i get an error like Port Already Open. But even in this error if i debug i still get mscomm1.portopen property false. So i couldn't detect if it's open or not.

What do you advice me to do?
if u wnat i may give you more detail. Thanks
 
Do you really need to see the state before you open it?
Why can't you just open/close then en masse?
 
Hi again!

THOMASNG: I need to know the state cus i get an error if it's already open. So i need the real value if it's open or not. If do not check whether that port is in use and directly say mscomm1.portopen=true then i'll get an error msg if other application (e.g. HyperTerminal) is connected to that port. Ok?

I need further help. Cus i think my problem is not easy as you think. But i'm sure that you'll find something to help me if you think again :)

Thanks for your help :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top