【VC开源代码栏目提醒】:网学会员,鉴于大家对VC开源代码十分关注,论文会员在此为大家搜集整理了“BindFileDlg.cpp”一文,供大家参考学习!
// BindFileDlg.cpp : implementation file
//
#include "stdafx.h"
#include "BindFile.h"
#include "BindFileDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
////////////////////////////////////////////////////////////////////////////
// 类名:CBindFileDlg
// 功能:进行可执行文件的绑定工作。
////////////////////////////////////////////////////////////////////////////
struct MODIFY_DATA {
unsigned int finder; // 常量(定位自身)
_off_t my_length; //文件长度(自身)
} modify_data = {0x12345678, 0};
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
CWBButton m_AboutOK; //改为位图按钮显示
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
DDX_Control(pDX, IDOK, m_AboutOK);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBindFileDlg dialog
CBindFileDlg::CBindFileDlg(CWnd* pParent /*=NULL*/)
: CDialog(CBindFileDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CBindFileDlg)
m_strFirstPath = _T("");
m_strSecondPath = _T("");
m_strFinalPath = _T("");
m_Parts = _T("状态显示:");
m_Sync = 0;
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CBindFileDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CBindFileDlg)
DDX_Control(pDX, IDC_PROGRESS, m_Progress);
DDX_Control(pDX, IDCANCEL, m_Cancel);
DDX_Control(pDX, IDC_SECONDBROWSE, m_SecondBrowse);
DDX_Control(pDX, IDC_FIRSTBROWSE, m_FirstBrowse);
DDX_Control(pDX, IDC_FINALBROWSE, m_FinalBrowse);
DDX_Control(pDX, IDC_BUTTON_BINDFILE, m_BindFile);
DDX_Control(pDX, IDC_BUTTON_ABOUT, m_About);
DDX_Control(pDX, IDC_SECONDPATH, m_SecondPath);
DDX_Control(pDX, IDC_FIRSTPATH, m_FirstPath);
DDX_Control(pDX, IDC_FINALPATH, m_FinalPath);
DDX_Text(pDX, IDC_FIRSTPATH, m_strFirstPath);
DDX_Text(pDX, IDC_SECONDPATH, m_strSecondPath);
DDX_Text(pDX, IDC_FINALPATH, m_strFinalPath);
DDX_Text(pDX, IDC_PARTS, m_Parts);
DDX_Radio(pDX, IDC_RADIO_SYNC, m_Sync);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CBindFileDlg, CDialog)
//{{AFX_MSG_MAP(CBindFileDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON_ABOUT, OnButtonAbout)
ON_BN_CLICKED(IDC_FIRSTBROWSE, OnFirstBrowse)
ON_BN_CLICKED(IDC_SECONDBROWSE, OnSecondBrowse)
ON_BN_CLICKED(IDC_FINALBROWSE, OnFinalBrowse)
ON_BN_CLICKED(IDC_BUTTON_BINDFILE, OnButtonBindFile)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CBindFileDlg message handlers
BOOL CBindFileDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX