1

I am interacting with a bill acceptor connected via serial in VB6 using the MSComm control. We're having some communication issues, and I have been tasked with using the Win32 API directly to interact with the serial port. I'm not quite sure where to begin. Any links, articles, or books would be greatly appreciated.

Geo Ego
  • 1,315
  • 7
  • 27
  • 53
  • "We're having some communication issues" - that's not very specific.... – Mitch Wheat Feb 08 '11 at 03:58
  • 1
    ... or you could post a question of the specific issue and get the answer here. Just saying... – Austin Salonen Feb 08 '11 at 04:01
  • I appreciate that. The issues that we're having are irrelevant to this question, though -- they're basically third-party driver issues that we're going to avoid altogether by sending raw hex. My client has some issues with the MSComm control and so would prefer to work directly with the Win32 API. That's good enough for me. – Geo Ego Feb 08 '11 at 04:41
  • If the driver issue is with a serial port adapter, you won't solve any problems by using the Win32 API. – Brad Feb 08 '11 at 14:23

2 Answers2

3

Serial Port Communication: perform serial port I/O without using the Microsoft Comm Control component

Mitch Wheat
  • 295,962
  • 43
  • 465
  • 541
  • I like that one alot, although the documentation is sparse. We used this, it solved our issues, but we found and switched to ActiveComport (http://www.activexperts.com/files/activcomport/manual.htm) after that because it was a cleaner solution with better documentation. Thanks for your help! – Geo Ego Feb 09 '11 at 21:40
0

Richard Grier

MarkJ
  • 30,070
  • 5
  • 68
  • 111
  • Fine for VB6, but his solution doesn't completely solve the issues with the .NET serial port class. His book is extremely dated, and while most of it still applies, look elsewhere if you end up upgrading this project to .NET. Nice guy though! – Brad Feb 08 '11 at 14:24
  • @Brad The question is tagged VB6 – MarkJ Feb 08 '11 at 15:30
  • yes, I completely agree. I was just pointing it out, so that if they decide to go to .NET later, they can add the serial port to the list of things they will need to completely redo. – Brad Feb 08 '11 at 16:11