Dlg_OCX.cpp 968 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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, NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT |OFN_ALLOWMULTISELECT|OFN_ENABLESIZING , _T("OCX Files (*.ocx)|*.ocx||"),NULL);
  30. if (dlg.DoModal() != IDOK)
  31. {
  32. return;
  33. }
  34. CString sPath = dlg.GetPathName();
  35. m_sEdit_OCXPath = sPath;
  36. UpdateData( false );
  37. }