1 ///////////////////////////////////////
\r
5 #include "MyDialog.h"
\r
6 #include "resource.h"
\r
9 // Definitions for the CMyDialog class
\r
10 CMyDialog::CMyDialog(UINT nResID, CWnd* pParent)
\r
11 : CDialog(nResID, pParent)
\r
13 m_hInstRichEdit = ::LoadLibrary(_T("RICHED32.DLL"));
\r
14 if (!m_hInstRichEdit)
\r
15 ::MessageBox(NULL, _T("CMyDialog::CRichView Failed to load RICHED32.DLL"), _T(""), MB_ICONWARNING);
\r
18 CMyDialog::~CMyDialog()
\r
20 ::FreeLibrary(m_hInstRichEdit);
\r
23 INT_PTR CMyDialog::DialogProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
\r
28 TRACE(_T("Dialog inside DLL destroyed\n"));
\r
29 ::PostQuitMessage(0);
\r
33 // Pass unhandled messages on to parent DialogProc
\r
34 return DialogProcDefault(uMsg, wParam, lParam);
\r
37 BOOL CMyDialog::OnCommand(WPARAM wParam, LPARAM lParam)
\r
39 UNREFERENCED_PARAMETER(lParam);
\r
41 switch (LOWORD(wParam))
\r
64 } //switch (LOWORD(wParam))
\r
69 BOOL CMyDialog::OnInitDialog()
\r
72 SetIconLarge(IDI_DIALOG);
\r
73 SetIconSmall(IDI_DIALOG);
\r
75 // Put some text in the edit boxes
\r
76 SetDlgItemText(IDC_EDIT1, _T("Edit Control"));
\r
77 SetDlgItemText(IDC_RICHEDIT1, _T("Rich Edit Window"));
\r
79 // Put some text in the list box
\r
80 for (int i = 0 ; i < 8 ; i++)
\r
81 SendDlgItemMessage(IDC_LIST1, LB_ADDSTRING, 0, (LPARAM) _T("List Box"));
\r
86 void CMyDialog::OnOK()
\r
88 ::MessageBox(NULL, _T("OK Button Pressed. Dialog will now end."), _T("Button"), MB_OK);
\r
92 void CMyDialog::OnButton()
\r
94 SetDlgItemText(IDC_STATIC3, _T("Button Pressed"));
\r
95 TRACE(_T("Button Pressed\n"));
\r
98 void CMyDialog::OnCheck1()
\r
100 SetDlgItemText(IDC_STATIC3, _T("Check Box 1"));
\r
101 TRACE(_T("Check Box 1\n"));
\r
104 void CMyDialog::OnCheck2()
\r
106 SetDlgItemText(IDC_STATIC3, _T("Check Box 2"));
\r
107 TRACE(_T("Check Box 2\n"));
\r
110 void CMyDialog::OnCheck3()
\r
112 SetDlgItemText(IDC_STATIC3, _T("Check Box 3"));
\r
113 TRACE(_T("Check Box 3\n"));
\r
116 void CMyDialog::OnRadio1()
\r
118 SetDlgItemText(IDC_STATIC3, _T("Radio 1"));
\r
119 TRACE(_T("Radio 1\n"));
\r
122 void CMyDialog::OnRadio2()
\r
124 SetDlgItemText(IDC_STATIC3, _T("Radio 2"));
\r
125 TRACE(_T("Radio 2\n"));
\r
128 void CMyDialog::OnRadio3()
\r
130 SetDlgItemText(IDC_STATIC3, _T("Radio 3"));
\r
131 TRACE(_T("Radio 3\n"));
\r