* * *

Author Topic: how to use the MSComm32.OCX with lazarus?  (Read 753 times)

greenzyzyzy

  • Full Member
  • ***
  • Posts: 170
how to use the MSComm32.OCX with lazarus?
« on: August 11, 2017, 12:17:30 pm »
how to use the MSComm32.OCX with lazarus?
just import the MSComm32.OCX library to lazarus.
but click the "active" property it show errors.but in delphi is no problem.
i do not know why.

mig-31

  • Full Member
  • ***
  • Posts: 224
Re: how to use the MSComm32.OCX with lazarus?
« Reply #1 on: August 11, 2017, 12:43:01 pm »
Use TBlockSerial class from SynaSer unit from Synapse package
instead of OLE Windows library
Lazarus 1.6 - Linux 32/64 bit, win32

avra

  • Hero Member
  • *****
  • Posts: 1172
    • Additional info
Re: how to use the MSComm32.OCX with lazarus?
« Reply #2 on: August 11, 2017, 12:46:36 pm »
If you still face problems then take a look at alternatives for serial communication here:
http://wiki.freepascal.org/Hardware_Access#Serial_Communication
ct2laz - Easily convert components and projects between Lazarus and CodeTyphon

greenzyzyzy

  • Full Member
  • ***
  • Posts: 170
Re: how to use the MSComm32.OCX with lazarus?
« Reply #3 on: August 17, 2017, 01:44:36 pm »
thanks all.

jamie

  • Full Member
  • ***
  • Posts: 207
Re: how to use the MSComm32.OCX with lazarus?
« Reply #4 on: August 23, 2017, 02:13:37 am »
I am working on a serial port interface at the moment. This class is based from another
Digital type class where different device interfaces can be use through the base.
 
 The base has a few abstract functions that need to be filled in depending on the
hardware link involved. The idea is to create a common interface for sending and write
data to Serial, USB and Ethernet devices.. 
 
 Things like Modbus comes to mind as a Protocol overlay with these etc.

 currently the serial part is just about finished, it supports Events for the Main thread so
it does not block but has a thread running in the background for the Reads and writes etc.

 I'll post back later on it.

avra

  • Hero Member
  • *****
  • Posts: 1172
    • Additional info
Re: how to use the MSComm32.OCX with lazarus?
« Reply #5 on: August 23, 2017, 08:57:16 am »
The idea is to create a common interface for sending and write data to Serial, USB and Ethernet devices.
Just curious, what will be the main difference between DataPort and your project?
https://github.com/serbod/dataport
ct2laz - Easily convert components and projects between Lazarus and CodeTyphon

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus