1. Structure:

 TrComPort.lib       - library file for MSVC
 TrComPort_BCB.lib   - library file for BCB
 TrComPort.h         - header file for C++
 TrComPort.pas       - interface module for ObjectPascal(Delphi)
 TrComPublicDefs.pas - interface module for ObjectPascal(Delphi)
 TrComPort.dll       - DLL for working with the COM port

2. Application example(?++):

#include "TrComPort.h"

INT PortId;
INT result;
BYTE wr_data[] = {1,2,3,4,5,6};
BYTE rd_buffer[16];

PortId = TrComPortOpen(0);// COM1
if( TRCOM_SUCCEEDED(PortId) ) {
   // the port is open - set connection parameters
   TPpbComPortParameters params = {tcpmpBaudRate|tcpmpDefaultTimeout|tcpmpByteSize|tcpmpStopBits|tcpmpCheckParity|tcpmpParity|tcpmpEnableRtsControl|tcpmpEnableDtrControl,
                                   CBR_9600,           // 9600 baud
                                   5000,               // default timeout 5 s.
                                   8,                  // 8 bits
                                   ONESTOPBIT,         // 1 stop bit
                                   0,                  // no parity check
                                   NOPARITY,           // no parity bit
                                   RTS_CONTROL_DISABLE,// initially, RTS-off
                                   DTR_CONTROL_ENABLE};// initially, DTR-on
   result = TrComPortSetConfig(PortId,&params);
   if( TRCOM_SUCCEEDED(result) ) {
      // parameters are set - set control signals(DTR-on, RTS-off)
      result = TrComPortSetControl(PortId, pcpscfSetDtr|pcpscfClearRts);
      if( TRCOM_SUCCEEDED(result) ) {
         // control signals are set - transmit and receive data
         // transmit 6 bytes, receive 1 byte, timeout - 1 s.
         result = TrComPortWriteAndRead(PortId, wr_data, 6, rd_buffer, 1, 1000);
         if( TRCOM_SUCCEEDED(result) ) { 
            // further actions
         }
      }
   }
   // since the port is not needed any more, close it
   result = TrComPortClose(PortId);
}

3. Application example(ObjectPascal):

unit MySuperPuperUnit;

uses TrComPort;

var
 PortId: Integer;
 res: Integer;
 wr_data: array [6] of Byte = {1,2,3,4,5,6};
 rd_buffer: array [16] of Byte;

PortId := TrComPortOpen(0); (* COM1 *)
if TRCOM_SUCCEEDED(PortId) then
begin
   // the port is open - set connection parameters
   TPpbComPortParameters params := (tcpmpBaudRate or tcpmpDefaultTimeout or tcpmpByteSize or tcpmpStopBits or tcpmpCheckParity or tcpmpParity or tcpmpEnableRtsControl or tcpmpEnableDtrControl,
                                   CBR_9600,           (* 9600 baud *)
                                   5000,               (* default timeout 5 s. *)
                                   8,                  (* 8 bits *)
                                   ONESTOPBIT,         (* 1 stop bit *)
                                   0,                  (* no parity check *)
                                   NOPARITY,           (* no parity bit *)
                                   RTS_CONTROL_DISABLE,(* initially, RTS-off *)
                                   DTR_CONTROL_ENABLE);(* initially, DTR-on *)
   res := TrComPortSetConfig(PortId,params);
   if TRCOM_SUCCEEDED(res) then
   begin
      (* parameters are set - set control signals(DTR-on, RTS-off) *)
      res := TrComPortSetControl(PortId, TRCOM_CTRL(tcpccSet,tcpccClear));
      if TRCOM_SUCCEEDED(result) then
      begin
         (* control signals are set - transmit and receive data
            transmit 6 bytes, receive 1 byte, timeout - 1 s. *)
         res := TrComPortWriteAndRead(PortId, wr_data, 6, rd_buffer, 1, 1000);
         if TRCOM_SUCCEEDED(result) then
         begin 
            (* further actions *)
         end;
      end;
   end;
   (* since the port is not needed any more, close it *)
   result = TrComPortClose(PortId);
end;

P.S. The above examples are offhand and have not been checked for performance. Data exchange in reality can be different.