|
-
Oct 12th, 2001, 08:47 AM
#1
Thread Starter
Lively Member
Creating Undetermined number of mscomm objects
A project I'm working on needs to control communications on multiple comm ports on the PC. This must be done inside an ActiveX EXE. My problem is I do not know how many ports and therefore how many mscomm objects will be needed at design time. I use some code to create a control listed below:
Public WithEvents commObj As MSComm
Private Sub Form_Load()
Set commObj = Controls.Add("MSCommLib.MSComm", "commObj")
With commObj
.CommPort = 1
.Settings = "9600,e,7,1"
.RThreshold = 1
.PortOpen = True
End With
End Sub
How do I make Public Declarations such as above once my code determines how many serial ports I will need? (Need the component accessible from anywhere in the program)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|