#pragma once
#include "afxcmn.h"
#include "R-HH-M3O-LEG42-USB-SDK.h"
#include "afxwin.h"

typedef struct _SCAN_CARD
{
	ECARDTYPE	eCardType;
	TCHAR*		szMsg;
}SCAN_TYPE, *PSCAN_TYPE;

class CDlgCardScan : public CPropertyPage
{
	DECLARE_DYNAMIC(CDlgCardScan)

public:
	CDlgCardScan();
	virtual ~CDlgCardScan();

	enum { IDD = IDD_DIALOG_CARD_SCAN };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
	virtual BOOL OnInitDialog();
	afx_msg void OnBnClickedOk();
	afx_msg void OnBnClickedButtonScanSave();
	afx_msg void OnBnClickedCheckSave();
	afx_msg void OnTimer(UINT_PTR nIDEvent);

private:
	CListCtrl	m_ctrlCard;
	CImageList	m_lstImage;

private:
	CString ByteToString(BYTE* pData, UINT nSize);
	void InsertColumn(UINT nCol, TCHAR* szData, UINT nMaxLen);
	void InsertItem(UINT nIntem, UINT nSubItem, TCHAR* szString, UINT nImage);
	void SetImageIcon(BOOL bOn);

private:
	CButton		m_ctrlSave;
	CEdit		m_ctrlSavePath;
	CButton		m_btnSave;

	SDKHANDLE	m_hSdk;
	UINT		m_nStepTimer;
};
