#pragma once

UINT ComReadThread(LPVOID pDlg);
UINT ComSendThread(LPVOID pDlg);
UINT socketReadThread(LPVOID pDlg);

// terminalDialog ダイアログ

class terminalDialog : public CDialog
{
	DECLARE_DYNAMIC(terminalDialog)

public:
	terminalDialog(CWnd* pParent = NULL);   // 標準コンストラクタ
	virtual ~terminalDialog();

// ダイアログ データ
	enum { IDD = IDD_TERMINAL_DIALOG };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV サポート

	DECLARE_MESSAGE_MAP()
public:
	virtual BOOL OnInitDialog();

	afx_msg void OnBnClickedSend();
	afx_msg void OnBnClickedButtonClear();
	afx_msg void OnBnClickedButtonDisconnect();
	afx_msg void OnDestroy();

	afx_msg LRESULT showReadData(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT showSendErrorDialog(WPARAM wParam, LPARAM lParam);

	volatile CWinThread* m_comReadThread;
	volatile CWinThread* m_comSendThread;
	volatile CWinThread* m_sockReadThread;

	CString m_strSend;
	CString m_strReceive;

	void releaseResources(void);
	BOOL m_connectType;
};
