[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Passing MSComm Control to a DLL

Posted on 1999-10-26
3
Medium Priority
?
418 Views
Last Modified: 2012-08-14
I am trying to pass a control of type MSComm to a dll. I have declared it as of type MSCommlib.MSComm. The initialization etc. for the comm port is done in the DLL. Now I want to use the OnComm event. Should I place it inside the DLL or in the form code where the MSComm control is placed. In either case the oncomm event is not getting fired even though the characters arrive in the receive buffer. I have set the RThreshold property to 1
0
Comment
Question by:riturajkhare
3 Comments
 
LVL 26

Expert Comment

by:EDDYKT
ID: 2162769
try

private withevents mycomm as mscommlib.mscomm

set mycomm = 'your pass in comm object'


you should have event called mycomm_onevent
0
 
LVL 3

Accepted Solution

by:
kfrick earned 100 total points
ID: 2164437
The OnComm event must be in the DLL.......
the DLL should recieve a message, then raise a "GotData(szData)" Event.
The form code then uses the "dllMyCommDll_GotData(szData)" event to accept the data from the DLL.................
Your DLL can perform message formatting and rejection, if required, before sending data to the calling form.....

Hope this helps!
-kf
0
 
LVL 9

Expert Comment

by:GivenRandy
ID: 2716084
Please fill in 'your pass in comm object'.  When I tried this, I got an error message (object not existing).
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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.
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…
Suggested Courses
Course of the Month9 days, 13 hours left to enroll

591 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