///////////////////////////////////////////////////////////////////////// // TestDialog.h - Demonstrate Out-Of-Proc component with Dialog // // // // Jim Fawcett, CSE775 - Distributed Objects, Spring 2009 // ///////////////////////////////////////////////////////////////////////// #pragma once #include "resource.h" // main symbols #include class CTestDialog : public CAxDialogImpl { public: CTestDialog() { } ~CTestDialog() { } enum { IDD = IDD_TESTDIALOG }; BEGIN_MSG_MAP(CTestDialog) MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) COMMAND_HANDLER(IDOK, BN_CLICKED, OnClickedOK) COMMAND_HANDLER(IDCANCEL, BN_CLICKED, OnClickedCancel) CHAIN_MSG_MAP(CAxDialogImpl) END_MSG_MAP() // Handler prototypes: // LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); // LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); // LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { CAxDialogImpl::OnInitDialog(uMsg, wParam, lParam, bHandled); bHandled = TRUE; return 1; // Let the system set the focus } LRESULT OnClickedOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) { PostQuitMessage(0); DestroyWindow(); return 0; } LRESULT OnClickedCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) { PostQuitMessage(0); DestroyWindow(); return 0; } };