CommMonitor8.0 SDK DLL version, this version is called directly to the DLL.
Delphi Invocation Definition:
Const
commmonitor8x = ' CommMOnitor8x.dll ';
Type
Tonmonitorl = procedure (
Seq:dword; Serial number
Dt:dword; Time
Ctrl:dword; Control code
Pid:dword; Process ID
Comnum:pansichar; Serial number
Size:dword; Data size
Vtasc:pansichar//ascii
); stdcall;
function StartMonitor (Ckey, Cportname:pansichar; funccallback:tonmonitorl): BOOL; stdcall; External commmonitor8x;
function Stopmonitor (): BOOL; stdcall; External commmonitor8x;
function Pausemonitor (bpause:bool): BOOL; stdcall; External commmonitor8x;
Procedure about (Handle:dword); stdcall; External commmonitor8x;
VS C # Call Definition:
[DllImport ("CommMonitor8x.dll",
CharSet = System.Runtime.InteropServices.CharSet.Ansi,
CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall,
entrypoint = "StartMonitor")]
public static extern bool StartMonitor (string key, String comname, IntPtr onmonitor);
[DllImport ("CommMonitor8x.dll", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall, EntryPoint = "about")]
public static extern void about (IntPtr Handle);
[DllImport ("CommMonitor8x.dll", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall, entrypoint = "Stopmonitor")]
public static extern bool Stopmonitor ();
[DllImport ("CommMonitor8x.dll", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall, entrypoint = "Pausemonitor")]
public static extern bool Pausemonitor (bool bpause);
public delegate void Onmonitor (
UINT SEQ,//serial number
UINT DT,//Time
UINT Dwctrlcode,//control code
UINT PID,//process ID
String sportname,//String number
UINT dwsize,//Data size
String Vtasc//ascii
);
Delphi, C # call, see demo.
Baidu Network Disk Download
Source: http://www.ceiwei.com/blog/index.php/2017/11/17/commmonitor8-0-sdk-dll_ver/
CommMonitor8.0 Serial Filter Driver SDK DLL version C#/delphi call demo