Link to home
Start Free TrialLog in
Avatar of ShanKonduru
ShanKonduru

asked on

how to Send data to Serial port (COM1) through DLLs without mscomm.ocx

Hi All,

How to Send data to a Serial port (COM1) through VB DLL without mscomm.ocx?

ThanX in advance...
Shan Konduru
Avatar of marconovaro
marconovaro


I guess there isn't another way of doing this, without using MSCOMM.

If "VB DLL" you mean an ActiveX DLL project without forms, then I would add a (dummy) form to the project, only used as a container for the MSCOMM object.

This form could be set as not visible (also at design time), and your DLL will continue working without an user interface.

Hope this helps
M
Try

Shell("print /d:com1 file.dat")

Where file.dat contains data you want to send via COM1.

Cheers
ASKER CERTIFIED SOLUTION
Avatar of emadat
emadat
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ShanKonduru

ASKER

Hi emadat:
Can i Read/Write to a comm port with Single Open Stmt?
Yes you can.
Nothing should prevent you from doing that.
but How? Can u please send a code for the same..
I realise this has been closed for a while now but for the record, another way of accessing the serial port via VB or VBA is to use Cheapcomm, a freeware OCX that does all the basic functions of MSCOMM.

I've used this successfully on a few projects.

See http://ourworld.compuserve.com/homepages/jacksilver/software.htm