Solved

passing mscomm to dll

Posted on 2004-10-05
1
497 Views
Last Modified: 2008-02-01
I have a dll with a form with mscomm ocx and a main class but the ocx doens't raise an port event when character incomming to the port (I follow other instruccion of

code of class
Dim f1 As New FrmPpal 'form
Private WithEvents mycomm As mscommlib.MSComm

Public Sub inicializa() ' i call this of other programm
   
  Set mycomm = f1.MSComm1
  mycomm.CommPort = 4
  mycomm.Settings = "9600,N,8,1"
  mycomm.RTSEnable = False
  mycomm.PortOpen = True
  mycomm.Output = "STATUS"
 
End Sub

Sub mycomm_onevent() ' when character incomming never raise
 
 Select Case mycomm.CommEvent
 
   ' ok
 
 End Select

0
Comment
Question by:cquiroga2
1 Comment
 
LVL 32

Accepted Solution

by:
Erick37 earned 250 total points
ID: 12231131
I believe the sub is OnComm, not OnEvent...

Private Sub mycomm_OnComm()
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now