COMM and I  
Author Message
kittyvickers





PostPosted: Wed Oct 10 11:49:53 PDT 2007 Top

Visual Basic >> COMM and I VB6SP6
Someone please point me to where I can find some sample code or
enlightenment to do Serial COMM without the MSCOMM1 component (using APIs
etc.).
Would like the ONCOMM event type capability rather than polling.

Visual Studio205  
 
 
Ken





PostPosted: Wed Oct 10 11:49:53 PDT 2007 Top

Visual Basic >> COMM and I "Lorin" <EMail@HideDomain.com> wrote in message
news:EMail@HideDomain.com...
> VB6SP6
> Someone please point me to where I can find some sample code or
> enlightenment to do Serial COMM without the MSCOMM1 component (using APIs
> etc.).
> Would like the ONCOMM event type capability rather than polling.

You don't like MSComm? I'm not sure of the specifics, but here's a sample
that allows....

Serial Comms with Windows API
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=3367&lngWId=1

...not sure what events it supports, though.

--
Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm


 
 
Lorin





PostPosted: Wed Oct 10 15:00:03 PDT 2007 Top

Visual Basic >> COMM and I
Just trying to avoid the form.

The example you cited is OK, but does not have anything like ONCOMM.
Another one I found was ARCCOMM. It additionally uses API timers.
http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=12423&lngWId=1

Too much fun!

"Ken Halter" wrote:

> "Lorin" <EMail@HideDomain.com> wrote in message
> news:EMail@HideDomain.com...
> > VB6SP6
> > Someone please point me to where I can find some sample code or
> > enlightenment to do Serial COMM without the MSCOMM1 component (using APIs
> > etc.).
> > Would like the ONCOMM event type capability rather than polling.
>
> You don't like MSComm? I'm not sure of the specifics, but here's a sample
> that allows....
>
> Serial Comms with Windows API
> http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=3367&lngWId=1
>
> ....not sure what events it supports, though.
>
> --
> Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
> In Loving Memory - http://www.vbsight.com/Remembrance.htm
>
>
>
 
 
Dick





PostPosted: Thu Oct 11 11:00:53 PDT 2007 Top

Visual Basic >> COMM and I Hi,

I have tons of example code in my book (see below).

However, the short of it is:

Set .RThreshold = 1 'this enables OnComm events
Then, in the OnComm event:
append newly received data to a buffer and process that buffer for the data
that you need -- if there is more in the buffer than you need for the
specific job at hand, retain that extra data so that the next OnComm event
can append newly received data -- so that none is lost between calls. Do
not assume that any specific number of characters will be delivered for each
OnComm receive event.

Dick

--
Richard Grier, MVP
Hard & Software
Author of Visual Basic Programmer's Guide to Serial Communications, Fourth
Edition,
ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
2006.
See www.hardandsoftware.net for details and contact information.