Solved

Detecting Com Port Settings ...

Posted on 2000-03-28
1
259 Views
Last Modified: 2010-04-04
Hi,

I have an old Delphi program (Compiled EXE only) which communicates via the serial port.

I need to get something talking to it, but I don't know the settings ...

Is there any way to get the com port settings whilst the program is running ?

Any help would be appreciated.

James
0
Comment
Question by:jatkin
1 Comment
 
LVL 7

Accepted Solution

by:
ahalya earned 100 total points
ID: 2664674
You can call the "GETCOMMSTATE" WinAPI to retrieve info about the current settings:  (I assume that you want to do it using programming)

 (the following info From Delphi files will be useful in that case)

function GetCommState(hFile: THandle; var lpDCB: TDCB): BOOL; stdcall;


the var DCB points to the following structure.

type
  TDCB = packed record
    DCBlength: DWORD;
    BaudRate: DWORD;
    Flags: Longint;
    wReserved: Word;
    XonLim: Word;
    XoffLim: Word;
    ByteSize: Byte;
    Parity: Byte;
    StopBits: Byte;
    XonChar: CHAR;
    XoffChar: CHAR;
    ErrorChar: CHAR;
    EofChar: CHAR;
    EvtChar: CHAR;
    wReserved1: Word;
  end;
  PDCB = ^TDCB;
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Show Listview image from database (String field) 5 134
Convert GUI app into console app for Win32 Env 5 109
control image tags in a string ? 12 141
MS Access from Delphi 31 59
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question