MyPwd.h
上传用户:weisheen
上传日期:2022-07-09
资源大小:19390k
文件大小:4k
- // MyPwd.h : Declaration of the CMyPwd
- #ifndef __MYPWD_H_
- #define __MYPWD_H_
- #include "resource.h" // main symbols
- #include <atlctl.h>
- #include "MyPwdChangeCP.h"
- /////////////////////////////////////////////////////////////////////////////
- // CMyPwd
- class ATL_NO_VTABLE CMyPwd :
- public CComObjectRootEx<CComSingleThreadModel>,
- public IDispatchImpl<IMyPwd, &IID_IMyPwd, &LIBID_MYPWDCHANGELib>,
- public CComCompositeControl<CMyPwd>,
- public IPersistStreamInitImpl<CMyPwd>,
- public IOleControlImpl<CMyPwd>,
- public IOleObjectImpl<CMyPwd>,
- public IOleInPlaceActiveObjectImpl<CMyPwd>,
- public IViewObjectExImpl<CMyPwd>,
- public IOleInPlaceObjectWindowlessImpl<CMyPwd>,
- public IPersistStorageImpl<CMyPwd>,
- public ISpecifyPropertyPagesImpl<CMyPwd>,
- public IQuickActivateImpl<CMyPwd>,
- public IDataObjectImpl<CMyPwd>,
- public IProvideClassInfo2Impl<&CLSID_MyPwd, NULL, &LIBID_MYPWDCHANGELib>,
- public CComCoClass<CMyPwd, &CLSID_MyPwd>,
- public CProxy_OnSuccess< CMyPwd >,
- public IConnectionPointContainerImpl<CMyPwd>
- {
- public:
- CMyPwd()
- {
- m_bWindowOnly = TRUE;
- CalcExtent(m_sizeExtent);
- }
- DECLARE_REGISTRY_RESOURCEID(IDR_MYPWD)
- DECLARE_PROTECT_FINAL_CONSTRUCT()
- BEGIN_COM_MAP(CMyPwd)
- COM_INTERFACE_ENTRY(IMyPwd)
- COM_INTERFACE_ENTRY(IDispatch)
- COM_INTERFACE_ENTRY(IViewObjectEx)
- COM_INTERFACE_ENTRY(IViewObject2)
- COM_INTERFACE_ENTRY(IViewObject)
- COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
- COM_INTERFACE_ENTRY(IOleInPlaceObject)
- COM_INTERFACE_ENTRY2(IOleWindow, IOleInPlaceObjectWindowless)
- COM_INTERFACE_ENTRY(IOleInPlaceActiveObject)
- COM_INTERFACE_ENTRY(IOleControl)
- COM_INTERFACE_ENTRY(IOleObject)
- COM_INTERFACE_ENTRY(IPersistStreamInit)
- COM_INTERFACE_ENTRY2(IPersist, IPersistStreamInit)
- COM_INTERFACE_ENTRY(ISpecifyPropertyPages)
- COM_INTERFACE_ENTRY(IQuickActivate)
- COM_INTERFACE_ENTRY(IPersistStorage)
- COM_INTERFACE_ENTRY(IDataObject)
- COM_INTERFACE_ENTRY(IProvideClassInfo)
- COM_INTERFACE_ENTRY(IProvideClassInfo2)
- COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer)
- END_COM_MAP()
- BEGIN_PROP_MAP(CMyPwd)
- PROP_DATA_ENTRY("_cx", m_sizeExtent.cx, VT_UI4)
- PROP_DATA_ENTRY("_cy", m_sizeExtent.cy, VT_UI4)
- // Example entries
- // PROP_ENTRY("Property Description", dispid, clsid)
- // PROP_PAGE(CLSID_StockColorPage)
- END_PROP_MAP()
- BEGIN_MSG_MAP(CMyPwd)
- CHAIN_MSG_MAP(CComCompositeControl<CMyPwd>)
- COMMAND_HANDLER(IDC_BUTTON2, BN_CLICKED, OnClickedButton2)
- 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);
- BEGIN_SINK_MAP(CMyPwd)
- //Make sure the Event Handlers have __stdcall calling convention
- END_SINK_MAP()
- STDMETHOD(OnAmbientPropertyChange)(DISPID dispid)
- {
- if (dispid == DISPID_AMBIENT_BACKCOLOR)
- {
- SetBackgroundColorFromAmbient();
- FireViewChange();
- }
- return IOleControlImpl<CMyPwd>::OnAmbientPropertyChange(dispid);
- }
- // IViewObjectEx
- DECLARE_VIEW_STATUS(0)
- // IMyPwd
- public:
- enum { IDD = IDD_MYPWD };
- public :
- BEGIN_CONNECTION_POINT_MAP(CMyPwd)
- CONNECTION_POINT_ENTRY(DIID__OnSuccess)
- END_CONNECTION_POINT_MAP()
- LRESULT OnClickedButton2(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
- {
- // TODO : Add Code for control notification handler.
- // 通过数据库修改密码;
- // 如果成功,则触发事件;
- this->Fire_Success(::SysAllocString(L"ok"));
return 0;
- }
- };
- #endif //__MYPWD_H_