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
Enumerating COM ports

 
Post new topic   Reply to topic    Forum Index -> Files
Author Message
dlh



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

Posted: 20 March 2007, 11:39 AM    Post subject: Enumerating COM ports Reply with quote

I've seen a few examples for this on the forums but none that correctly enumerated the ports on all my machines.

enum_ports.zip includes VB4-32 source code which does correctly enumerate all ports of all types (real and virtual) on my W98SE and XP systems. I no longer have a W2K machine so it has not been tested there.

It enumerates all the ports, filters out duplicates, infrared, etc. and adds all valid and available ports to a menu. (You could add them to a combo box instead.) It writes the current port to the registry and retrieves it at startup.

If you start it with the word ports on the command line it will output all of the RAW data to COMports.log. I've include a sample log from one of my older machines that has seen a lot of development work.

This was originally written for VB5 or VB6 and I had to modify it for VB4-32 so it should be fairly easy to get it running under VB5 or VB6. I think I had to find a way to convert the Unicode strings returned by the API. I believe later versions of VB had a function for this.

I've include a compiled example and the MSComm32.OCX control. You may need to register the OCX to run the example.



enum_ports.zip
 Description:
VB4-32 source code for enumerating COM ports

Download
 Filename:  enum_ports.zip
 Filesize:  60.1 KB
 Downloaded:  3331 Time(s)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> Files Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


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