reading data from arduino to MFC

Can i put the reading data code into OnInitDialog();?

CDialogEx::OnInitDialog();

				
				// IDM_ABOUTBOX must be in the system command range.
				ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
				ASSERT(IDM_ABOUTBOX < 0xF000);

				CMenu* pSysMenu = GetSystemMenu(FALSE);
				if (pSysMenu != NULL)
				{
					BOOL bNameValid;
					CString strAboutMenu;
					bNameValid = strAboutMenu.LoadString(IDS_ABOUTBOX);
					ASSERT(bNameValid);
					if (!strAboutMenu.IsEmpty())
					{
						pSysMenu->AppendMenu(MF_SEPARATOR);
						pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
					}



					SerialPort* arduino = new SerialPort(Port);
						if (arduino->isConnected())
						{
							cout<<"Connection is made"<<endl<<endl;

						}
						else
						{
							cout<<"Error in port name"<<endl<<endl;
						}
	
						while(arduino->isConnected())
						{
							int read_result =  arduino->readSerialPort(incomingData,MAX_DATA_LENGTH);
							puts(incomingData);
							Sleep(10);
						}
				}

Does that seem to be an Arduino question to you? Not to me.

Paul