c# ref keyword... Am i passing my value correctly?
- by Pandiya Chendur
Is this a valid value for this c# class default constructor,
public class SMSCOMMS
{
public SMSCOMMS(ref string COMMPORT)
{
SMSPort = new SerialPort();
SMSPort.PortName = COMMPORT;
SMSPort.BaudRate = 9600;
SMSPort.Parity = Parity.None;
SMSPort.DataBits = 8;
SMSPort.StopBits = StopBits.One;
SMSPort.Handshake = Handshake.RequestToSend;
SMSPort.DtrEnable = true;
SMSPort.RtsEnable = true;
SMSPort.NewLine = System.Environment.NewLine;
ReadThread = new Thread(
new System.Threading.ThreadStart(ReadPort));
}
and i am passing this value,
SMSCOMMS SMSEngine = new SMSCOMMS("COM6"); but it doesn't seem to take "COM6" as a valid ref string... Any suggestion..