Dlg_OCX.cpp 972 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Dlg_OCX.cpp : 实现文件
  2. //
  3. #include "stdafx.h"
  4. #include "Dlg_OCX.h"
  5. #include ".\dlg_ocx.h"
  6. // CDlg_OCX 对话框
  7. IMPLEMENT_DYNAMIC(CDlg_OCX, CPropertyPage)
  8. CDlg_OCX::CDlg_OCX()
  9. : CPropertyPage(CDlg_OCX::IDD)
  10. , m_sEdit_OCXPath(_T(""))
  11. , m_nComb_OCXIndex(0)
  12. {
  13. }
  14. CDlg_OCX::~CDlg_OCX()
  15. {
  16. }
  17. void CDlg_OCX::DoDataExchange(CDataExchange* pDX)
  18. {
  19. CPropertyPage::DoDataExchange(pDX);
  20. DDX_Text(pDX, IDC_EDIT_OCXPATH, m_sEdit_OCXPath);
  21. DDX_CBIndex(pDX, IDC_COMBO_OCXINDEX, m_nComb_OCXIndex);
  22. }
  23. BEGIN_MESSAGE_MAP(CDlg_OCX, CPropertyPage)
  24. ON_BN_CLICKED(IDC_BTN_BROWSE, OnBnClickedBtnBrowse)
  25. END_MESSAGE_MAP()
  26. // CDlg_OCX 消息处理程序
  27. void CDlg_OCX::OnBnClickedBtnBrowse()
  28. {
  29. CFileDialog dlg(TRUE,NULL,
  30. NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT |OFN_ALLOWMULTISELECT|OFN_ENABLESIZING ,
  31. _T("OCX Files (*.ocx)|*.ocx||"),NULL);
  32. if (dlg.DoModal() != IDOK)
  33. {
  34. return;
  35. }
  36. CString sPath = dlg.GetPathName();
  37. m_sEdit_OCXPath = sPath;
  38. UpdateData( false );
  39. }