Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Free serial port activex control
#3
Well, *exactly* 3 years later, I do have an example. Big Grin That ActiveX control, NETCommOCX, broke when I updated to Windows 7. I lost interest for a while. I just got StrokeReader to work great with QM on Win 7 and XP this weekend. Every other solution I found was too expensive. StrokeReader is free for demo or $7 per user.
Some steps:
  • Install the StrokeReader ActiveX control.
  • Create a smart dialog in QM and add the control to the dialog.
  • Click the COM control in the dialog.
  • Click the events button.
  • Then click Apply and Close. Much of the code to register and initialize the control is created for you.
  • To create an event handler, under the WM_INITDIALOG case statement, type the name that QM gave the new StrokeReader control for your dialog (mine was st3), then type “.” and select CommEvent from the list. Some code, a folder, and an event handler function will be automatically generated.
  • Use the StrokeReader website to help with initialization and configuration of the serial port.
  • The event handler function will be called when the StrokeReader control receives data, connects, disconnects, etc. Handle the event based on the data passed to the function.


My dialog looks like this so far:
Function MultiScroll_Config_GUI
Code:
Copy      Help
;\Dialog_Editor
typelib StrokeReaderLib {ED7AED90-6B75-406A-A856-CEFDC6E021FB} 1.76
function# hDlg message wParam lParam
if(hDlg) goto messages


;BEGIN DIALOG
;0 "" 0x90C80AC8 0x80 0 0 53 14 "MultiScroll"
;1 Button 0x54030001 0x4 14 0 26 12 "Exit"
;3 ActiveX 0x54030000 0x0 32 2 18 10 "StrokeReaderLib.StrokeReader {7E42B8C5-73BE-4806-8904-FF4080A696EC}"
;END DIALOG
;DIALOG EDITOR: "" 0x2030307 "" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,StrokeReaderLib.StrokeReader st3
,st3._getcontrol(id(3 hDlg))
,st3._setevents("st3__DStrokeReaderEvents")
,st3.BaudRate=4800
,st3.DataBits=8
,st3.DataMode = 1 ;;1 text, 0 is binary
,st3.PARITY = 0 ;;none
,st3.STOPBITS = 0 ;;1 stop bit
,st3.Port = 6
,st3.RecvIntervalTimeout=1
,st3.RecvSizeThreshold=1
,st3.Connected = 0
,st3.Connected = 1
,
,case WM_DESTROY
,,st3.Connected = 0
,,
,case WM_COMMAND goto messages2
ret

;messages2
sel wParam
,case IDOK
,,st3.Connected = 0
ret 1

err+
,st3.Connected = 0
Matt B


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)