2 Replies - 3373 Views - Last Post: 19 September 2012 - 02:47 AM Rate Topic: -----

#1 tbzserge  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 30
  • Joined: 26-January 11

Run time Error 8015 on VB6 (print via serial port)

Posted 17 September 2012 - 02:43 AM

Hi all,

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.

Is This A Good Question/Topic? 0
  • +

Replies To: Run time Error 8015 on VB6 (print via serial port)

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 303
  • View blog
  • Posts: 1,797
  • Joined: 26-March 09

Re: Run time Error 8015 on VB6 (print via serial port)

Posted 17 September 2012 - 06:46 AM

Take a look at this link
Was This Post Helpful? 0
  • +
  • -

#3 tbzserge  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 30
  • Joined: 26-January 11

Re: Run time Error 8015 on VB6 (print via serial port)

Posted 19 September 2012 - 02:47 AM

Hi maj3091

Thanks. I was able to solve it based on the link that you gave.
I did come across that page before but have not actual testing it out.

Thanks again.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1