My program consist of two classes: Form1 (windows form with textbox) and SerialCommunication (class for serial communication).
When data occurs on COM port DateRecievedHandeler store the message to indata.
public ref class SerialCommunication
{
private:
static SerialPort^ mySerialPort;
public:
static String^ indata;
static void OpenPort();
static void Close();
static void DataReceivedHandler(Object^ sender, SerialDataReceivedEventArgs^ e);
};
In Form1 are included SerialCommunication.h and I have initialized object from SerialCommunication.
How to write method in class Form1 that will print indata to textbox from Form1 after DataRecievedHandler occurs.
Program is written in Visual C++ 2008 CLI aplication.