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

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..

thanks..

Liung012
liung012Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

eamonkCommented:
Hi,
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
        Else
            str = "Comm Port " & i & " is available."
            lstAvailable.AddItem str
        End If
        Me.Refresh
        Err.Clear
        MSComm1.PortOpen = False
 Next i

EamonK.
   
0
CleanupPingCommented:
liung012:
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?
0
DanRollinsCommented:
liung012, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Save as PAQ -- No Refund.

DanRollins -- EE database cleanup volunteer
0
Computer101Commented:
PAQed - no points refunded (of 50)

Computer101
E-E Admin
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.