// demoDlg.h : header file
//

#if !defined(AFX_DEMODLG_H__B93AA478_4467_11D3_94C2_0060976EBE6B__INCLUDED_)
#define AFX_DEMODLG_H__B93AA478_4467_11D3_94C2_0060976EBE6B__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000


// ASCII characters that receive special processing
#define ASCII_BEL  0x07
#define ASCII_BS   0x08
#define ASCII_TAB  0x09
#define ASCII_LF   0x0A
#define ASCII_CR   0x0D
#define ASCII_XON  0x11
#define ASCII_XOFF 0x13
/////////////////////////////////////////////////////////////////////////////
// Secondary thread 
UINT SendSliderDataInLoop(LPVOID lpParam);

// CDemoDlg dialog

class CDemoDlg : public CDialog
{
// Construction
public:
    volatile BOOL m_bConnected;
    long m_nBaud;
	int m_nDataBits;
	BOOL m_bDTRDSR;
	int m_nParity;
	CString m_sPort;
	BOOL m_bRTSCTS;
	int m_nStopBits;
	BOOL m_bXONXOFF;
    volatile HANDLE m_idComDev;
	CWinThread *m_pThread;
	OVERLAPPED m_osWrite, m_osRead;

    CDemoDlg(CWnd* pParent = NULL);	// standard constructor

    BOOL WriteCommByte(char cChar);
	BOOL WriteTTYBlock(LPSTR lpBlock, int nLength);
	int ReadCommBlock(LPSTR lpBlock, int nMaxLength);
	BOOL SetupConnection();
    int		m_radio_control;
// Dialog Data
	//{{AFX_DATA(CDemoDlg)
	enum { IDD = IDD_DEMO_DIALOG };
	CSliderCtrl	m_controlD;
	CSliderCtrl	m_controlC;
	CSliderCtrl	m_controlB;
	CSliderCtrl	m_controlA;

	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDemoDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
    HICON m_hIcon;

	BOOL OpenConnection();
	void CloseConnection();

	// Generated message map functions
	//{{AFX_MSG(CDemoDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnDestroy();
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnButtonAbout();
	afx_msg void OnComSettings();
	afx_msg void OnRadioNone();
	afx_msg void OnRadioPlayback0();
	afx_msg void OnRadioPlayback1();
	afx_msg void OnRadioSliderLoop();
	afx_msg void OnRadioSliderMemory();
	virtual void OnOK();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DEMODLG_H__B93AA478_4467_11D3_94C2_0060976EBE6B__INCLUDED_)
