Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
USB to VB6 CommPort Numbers
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Forum Index -> General
Author Message
DocJC



Joined: 16 Mar 2006
Posts: 90
Location: Cleveland, OH

Posted: 09 April 2007, 18:17 PM    Post subject: VB6 MSCOMM Hack Reply with quote

With the addition of the USB to Serial converter available from Don, and others, I suspect more an more people will be implementing USB interfaces instead of classic RS-232 interfaces to PCs.

If one is writing the PC interface in VB6 the following info may be helpful:

On my PC a FTDI USB to Serial converter enumerated itself as Port 22, and I could NOT directly access it with the VB6 MSCOMM control.

Changing the Port from within the Hardware Manager was one work around solution, although the user has to pick a port with a lower number that is not in use, and will not become in use while the current device is using the port.

It turns out that the MSCOMM control only works with ports up through number 16, but the OCX file can be changed to allow it to work with higher port numbers.

Using a hex editor, look for the following 3 byte sequence 3D 10 00 within the file (C:\windows\system32\) MSCOMM32.OCX

The middle byte, 10, (hex) is the upper port limit. Change it to 99 (or whatever), to increase the number of ports the control will utilize.

Save the file and re-boot.

You can now easily, directly, access devices, such as the USB to Serial Module(s), than are enumerated to high port numbers.

Much thanks to Strongm on the tek-tips forum for this insight!

JC
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2593
Location: Portland, OR

Posted: 09 April 2007, 18:52 PM    Post subject: Re: VB6 MSCOMM Hack Reply with quote

DocJC wrote:
The middle byte, 10, (hex) is the upper port limit. Change it to 99 (or whatever), to increase the number of ports the control will utilize.

Although it probably doesn't matter much, if you want the highest allowable port number to be 99 the value &H63 should be used.
Back to top
dlh



Joined: 15 Dec 2006
Posts: 287
Location: ~Cincinnati

Posted: 18 April 2007, 0:03 AM    Post subject: Reply with quote

Apparently, this depends on the version of MSCOMM32.OCX. The version that is on my original VB4-32 CD dated 7/26/95 does not have the 3D 10 00 byte sequence while later [e.g. 6/24/98] versions do.
Back to top
stevech



Joined: 23 Feb 2006
Posts: 688

Posted: 18 April 2007, 16:03 PM    Post subject: Reply with quote

I recall that very old versions had a limit of like 16. But for quite some time it's been 255 or some such. I've used numbers in the 30's. One source for the DLL is somewhere on Maxstream's website
http://maxstream.net/
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> General Time synchro. with the server - Timezone/DST with your computer
Goto page Previous  1, 2
Page 2 of 2

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group