Hi,
Has anyone got a sample code of how to Open/Close/Read/Write from COM Port.
Thanks
I do this now on 16 bit using MSCOMM DLL declarations to USER.DLL
Problem is that Microsoft went and changed things in 32 bit.
We are currently in the middle of converting this to CreateFile and ReadFile (the successors to MSCOMM), but it is not so easy to do.
If you want 16 bit, then I can advise.
In the interim, what I have done is write a small VB program to 'talk' to the COM port using MSCOMM and then I can pick up information from TXT files.
What sort of thing are you after?
Seria Comm - This is my Xmas project. BTW you can use OCX such as Microsoft MSComm or other - they are wrappers on the the API read file / write file.
Using the MSComm OCX I can download by polling and get_property the buffer but this is not a great way - better to have event trigger - but thats when it getts messy. Love to here others experience.
Being a purist I think the best way is to construct a SSP wrapper round the API - that can both be run from command line and from Dialog box.
Thats what I have in mind but Xmas cheer and gluttony will undoubtedly cloud my judgement and will probably forget any useful thing I do over the period likewise any resolutions for the new year.
Richard Bright
Colin, the best example of an RBasic+ wrapper round the file open / read / write for comm will get you a well earned chocolate fish at the May 2005 Rev Conference in Las Vegas. Well thats what I think Mike said. Or was it a box of …
Richard Bright
The Winmsg WM_COMMNOTIFY=68 ;* 0x44
Can be used to trigger the requirement to do a read from the com port, using ReadComm (User.DLL)
Saves using polling, but is 16 bit… tsk tsk.
I am looking at thunking this as the ReadFile is just too messy.
Watch this space…
Which comm port and what address?