[an error occurred while processing this directive]
[an error occurred while processing this directive]
|
Answer to Q.1: Enumerating ports
procedure EnumComPorts(Ports: TStrings);
Enumerates serial ports on local computer.
Call EnumComPorts to fill Ports paramater with installed com ports on local computer. Ports parameter is a TString descendant created and maintained by the application. Application can assign Ports member to PortNum property to set port number.
//---------------------------------
Before setting serial port number, it is useful to call EnumComPorts procedure to enumerate serial ports on local machine. Application can then assign a member of TStrings result to PortNum property.
Example
begin
EnumComPorts(ComboBox1.Items);
// do some stuff
ComPort1.PortNum := ComboBox1.Items[ComboBox1.ItemIndex];
end;
E-mail: info@telesys.ru