www.pudn.com > TestRS.rar > RSDlg.cpp
// RSDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Test.h"
#include "RSDlg.h"
#include "EnDe_Code.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRSDlg dialog
CRSDlg::CRSDlg(CWnd* pParent /*=NULL*/)
: CDialog(CRSDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CRSDlg)
m_ResData = _T("");
m_RSCode = _T("");
//}}AFX_DATA_INIT
data=NULL;
}
void CRSDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRSDlg)
DDX_Control(pDX, IDC_EDIT_RSCODE, m_edCode);
DDX_Text(pDX, IDC_EDIT_RESDATA, m_ResData);
DDX_Text(pDX, IDC_EDIT_RSCODE, m_RSCode);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CRSDlg, CDialog)
//{{AFX_MSG_MAP(CRSDlg)
ON_BN_CLICKED(IDC_BUTTON_RSCODE, OnButtonRscode)
ON_BN_CLICKED(IDC_BUTTON_INITDATA, OnButtonInitdata)
ON_BN_CLICKED(IDC_BUTTON_RSDECODE, OnButtonRsdecode)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRSDlg message handlers
void CRSDlg::OnButtonRscode()
{
// TODO: Add your control notification handler code here
if(!data)
return ;
CEnDe_Code code;
code.encode(data);
CString lineno;
m_RSCode.Empty();
for(int i=1;i>=1;
// TRACE("mask:%\n",mask);
}
bits+=" ";
return bits;
}
void CRSDlg::OnButtonRsdecode()
{
// TODO: Add your control notification handler code here
if(data==NULL) return;
ReceiveData();
CEnDe_Code code;
code.decode(data);
CString lineno;
m_RSCode="";
UpdateData(FALSE);
Sleep(2000);
for(int i=1;i>=1;
}
return byte;
}
BOOL CRSDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CEdit *pWnd=(CEdit *)GetDlgItem(IDC_EDIT_RESDATA);
pWnd->SetReadOnly(TRUE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}