For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > November 2005 > Comm Port 16 and Higher









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Comm Port 16 and Higher
Chuck Faranda

2005-11-21, 7:55 am

Is there any simple way to get access to comm ports 16 and higher?
--
Regards,
Chuck


Veign

2005-11-21, 6:55 pm

There was a hack that came around about modifying the MsComm control to
access greater than 16 ports:
"In the code there is a unique sequence of three bytes, 3d 10 00. Pick a hex
editor and change the value 10 to say 7f. Now you have changed the default
value of a variable MAX_PORTS to 127. The name of the variable is arbitrary.
Save the changed file and off you go."

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--


"Chuck Faranda" <astrocody@hotmail.com> wrote in message
news:MYCdnQabhNc7PxzeRVn-iQ@comcast.com...
> Is there any simple way to get access to comm ports 16 and higher?
> --
> Regards,
> Chuck
>
>



Dick Grier

2005-11-21, 6:55 pm

Hi,

You can use the Windows API (I have example code in my book). MSComm is
limited to Com1-16, though there is a "hack" that employs a binary editor to
remove this limitation. If you scan the archives (google), you should find
it.

Personally, I prefer Sax Comm Objects for high-performance communications,
as applications that access the higher-number ports often use multiple ports
simultaneously (www.sax.net).

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.


Chuck Faranda

2005-11-21, 9:55 pm

Ah, I'll give it a try. thanks!

--

Regards,
Chuck Faranda
http://ccdastro.net


"Veign" <NOSPAMinveign@veign.com> wrote in message
news:OqaCiot7FHA.3984@TK2MSFTNGP11.phx.gbl...
> There was a hack that came around about modifying the MsComm control to
> access greater than 16 ports:
> "In the code there is a unique sequence of three bytes, 3d 10 00. Pick a
> hex
> editor and change the value 10 to say 7f. Now you have changed the default
> value of a variable MAX_PORTS to 127. The name of the variable is
> arbitrary.
> Save the changed file and off you go."
>
> --
> Chris Hanscom - Microsoft MVP (VB)
> Veign's Resource Center
> http://www.veign.com/vrc_main.asp
> Veign's Blog
> http://www.veign.com/blog
> --
>
>
> "Chuck Faranda" <astrocody@hotmail.com> wrote in message
> news:MYCdnQabhNc7PxzeRVn-iQ@comcast.com...
>
>



Chuck Faranda

2005-11-22, 6:55 pm

I forgot to ask if the hack will have any negative effects on other apps, or
present any 'rights' hassles . With the proliferation of USB to serial
devices prompting higher port numbers, I wonder why this 'hack' isn't
adopted as the standard?
--
Regards,
Chuck
[color=darkred]


Veign

2005-11-22, 6:55 pm

I don't know enough about the hack and its a use at your own risk. Also,
not sure about licensing issues. I would recommend one of the alternative
solutions provided by Dick Grier...

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--


"Chuck Faranda" <astrocody@hotmail.com> wrote in message
news:8vOdnWQ-nachBB7eRVn-jA@comcast.com...
>I forgot to ask if the hack will have any negative effects on other apps,
>or present any 'rights' hassles . With the proliferation of USB to serial
>devices prompting higher port numbers, I wonder why this 'hack' isn't
>adopted as the standard?
> --
> Regards,
> Chuck
>
>
>



Stefan Berglund

2005-11-22, 6:55 pm

On Tue, 22 Nov 2005 17:20:43 -0500, "Chuck Faranda" <astrocody@hotmail.com>
wrote:
in <8vOdnWQ-nachBB7eRVn-jA@comcast.com>

>I forgot to ask if the hack will have any negative effects on other apps, or
>present any 'rights' hassles . With the proliferation of USB to serial
>devices prompting higher port numbers, I wonder why this 'hack' isn't
>adopted as the standard?


Just how many telescopes are you remotely controlling these days?

---
Stefan Berglund
Chuck Faranda

2005-11-22, 6:55 pm

<G>, too many according to my wife.

--

Regards,
Chuck

"Stefan Berglund" <keepit@in.thegroups> wrote in message
news:sia7o1pfqg8mvll5lq082hjl1lgn95assl@
4ax.com...
> On Tue, 22 Nov 2005 17:20:43 -0500, "Chuck Faranda"
> <astrocody@hotmail.com>
> wrote:
> in <8vOdnWQ-nachBB7eRVn-jA@comcast.com>
>
>
> Just how many telescopes are you remotely controlling these days?
>
> ---
> Stefan Berglund



Chuck Faranda

2005-11-22, 6:55 pm

Just ordered the book, got a page number <g>.
--
Regards,
Chuck

"Dick Grier" <dick_grierNOSPAM@msn.com> wrote in message
news:eDtJZwt7FHA.1416@TK2MSFTNGP09.phx.gbl...
> Hi,
>
> You can use the Windows API (I have example code in my book). MSComm is
> limited to Com1-16, though there is a "hack" that employs a binary editor
> to remove this limitation. If you scan the archives (google), you should
> find it.
>
> Personally, I prefer Sax Comm Objects for high-performance communications,
> as applications that access the higher-number ports often use multiple
> ports simultaneously (www.sax.net).
>
> Dick
>
> --
> Richard Grier (Microsoft Visual Basic MVP)
>
> See www.hardandsoftware.net for contact information.
>
> Author of Visual Basic Programmer's Guide to Serial Communications, 4th
> Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
> www.mabry.com/vbpgser4 to order.
>
>



Dick Grier

2005-11-23, 6:55 pm

Hi Chuck,

I haven't used it, so I don't "know." But, I doubt that there are any
negative side effects. Why MS coded it that way in the first place is
historical, I think. The original MSComm.vbx written for VB2 had this
limitation (16-bit code), and they simply brought it forward into the 32-bit
implementations.

The only problems with the hack are:

1- MS has a Copyright on the OCX and the license (basically) states that you
cannot decompile it (not an issue here), nor modify it (probably they don't
care, but who knows?).
2- MS doesn't provide any on-going support for VB6, except $$$, and even
then, they aren't modifying any of the underlying VB6 code base.
3- Suppose some other application installs the unmodified MSComm32.ocx over
your copy? All of a sudden your code stops working, and you have a support
problem. Of course, you may not care about this; you may own the
computer(s) and it is an unfriendly act to install an "older" version over
the newer... But, this might cause some concern.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.


J French

2005-11-24, 7:55 am

On Wed, 23 Nov 2005 10:46:09 -0700, "Dick Grier"
<dick_grierNOSPAM@msn.com> wrote:

<snip>

>3- Suppose some other application installs the unmodified MSComm32.ocx over
>your copy? All of a sudden your code stops working, and you have a support
>problem. Of course, you may not care about this; you may own the
>computer(s) and it is an unfriendly act to install an "older" version over
>the newer... But, this might cause some concern.


I suppose he could rename the OCX, hack its interrnal name and its
GUID

Personally I would use the APIs CreateFile, ReadFile etc

One could simulate an Event by hijacking a Timer and using Sleep() and
DoEvents
Dick Grier

2005-11-25, 6:55 pm

Hi,
[color=darkred]
I suppose he could rename the OCX, hack its interrnal name and its
GUID
<<

This DEFINITLY would violate the license. That's not any territory that I'd
visit.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com