Solved

Detecting Com Port Settings ...

Posted on 2000-03-28
1
254 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now