create an ActiveXEXE to get input from a device through serial comm?

Posted on 2003-02-24
Medium Priority
Last Modified: 2011-09-20
Hi, i wanna create an activeXEXE to get input from a device through serial comm port?
I mean,I'll be always to fact serial comm programmin. get data from same device. So, i don't need to write again the coding for that. you may be ask "why do you have to crate an activeXEXE? why not an activeXDLL?"
that answer is because my application (main application) has a routine task on every second. that it'll not disturb the routine.
actually, i have created what i excatly wanted, but i couldn't fire my event in the mssomm1_event (recieve event). it could open/close port, just couldn't get input from device.

oh ya, I have PCI communication Port installed to my computer (Port 5 and 6). but when i scanned using mscomm i just got 2 default comm port (1 and 2). My pci comm port is RS485.
does mscomm has limited to 4 ports (1,2,3,4) ?

Please help me to solve this problem..


Question by:liung012
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8016121
The mscomm control supports comm ports 1 up to 16.

You could try calling:
Setting the MS Comm Control CommPort Property to 4 (and next 5).
Call the PortOpen method of the MS Comm Control.
If the PortOpen is True then MSComm can access the Port, if false there is a problem.

I have included some sample code:

For i = 0 To 6
        MSComm1.CommPort = i
        MSComm1.PortOpen = True
        If Not MSComm1.PortOpen Then
            str = "Comm Port " & i & " is unavailable."
            lstUnavailable.AddItem str
            lstUnavailable.AddItem Err.Description
            str = "Comm Port " & i & " is available."
            lstAvailable.AddItem str
        End If
        MSComm1.PortOpen = False
 Next i


Expert Comment

ID: 8901218
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
LVL 49

Expert Comment

ID: 8972579
liung012, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Save as PAQ -- No Refund.

DanRollins -- EE database cleanup volunteer

Accepted Solution

Computer101 earned 0 total points
ID: 9667914
PAQed - no points refunded (of 50)

E-E Admin

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question