????? ????? ????? ?? ????? MFC ???????? Visual C++

?????? ????????? ?????? ?????????
???? ???????: 141277 - ??? ???????? ???? ????? ????? ??? ???????.
??? ????? ??? ???????. ????? "??? ??" ??? ??? ??????? ??? ????.
?????? ?????? NET C++ Microsoft Visual (2002) ??? ??????? ?????? ??? ??????? ?????? ??????? ?? ???? ?????? .NET Framework ? Windows ?????? ??? ???? ????? ????????? ????????. ????? ????????? ??????? ?? ??? ??????? ??? ??? ???? Visual C++ ????????? ???????? ???.

?????? ??? Microsoft Visual C++ 2005 ??? ??????? ?????? ??? ??????? ?????? ??????? ?? ???? ?????? .NET Framework ? Windows ?????? ??? ???? ????? ????????? ????????.
????? ???? | ?? ????

??????

?? ????? MFC ???? ???? ????? ???????? ???????? ?? ??? ????? ????? ?????? ??????. ????? ????? ?? ??? ?????? ????????? ?? ??????? ?????. ???? ?????? ?? ??? ??????? ????? ????? ????? ?? ??? ?? ???????? ????? ????? ?????? ???? ??? ???? ????? ??? ?????? ????? ????? ?????.

?? ????? ??? ??????? ?? ????? ????? IDispatch ??? ??? ???? ????. ?????? ??? ???? ?? ????????? ??? ????? ????? IDispatch ?? MFC ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
140616??????? ????? IDispatch MFC

??????? ????

??????? ??????? ??????? ?? IOleObject ??????? ?????????? ???? ?????? OLE ???? ?? ??????? ?????? "????? ??????".

  1. ?????? ????? ????? IOleObject ??? ???? ?????? ?????? ???????? ???????? ??????? ??? ??? ????? ??? ????? COleControl:
          // Interface Maps
          protected:
               // IOleObject
               BEGIN_INTERFACE_PART(MyOleObject, IOleObject)
                   INIT_INTERFACE_PART(CIOleOverCtrl, MyOleObject)
                   STDMETHOD(SetClientSite)(LPOLECLIENTSITE);
                   STDMETHOD(GetClientSite)(LPOLECLIENTSITE*);
                   STDMETHOD(SetHostNames)(LPCOLESTR, LPCOLESTR);
                   STDMETHOD(Close)(DWORD);
                   STDMETHOD(SetMoniker)(DWORD, LPMONIKER);
                   STDMETHOD(GetMoniker)(DWORD, DWORD, LPMONIKER*);
                   STDMETHOD(InitFromData)(LPDATAOBJECT, BOOL, DWORD);
                   STDMETHOD(GetClipboardData)(DWORD, LPDATAOBJECT*);
                   STDMETHOD(DoVerb)(LONG, LPMSG, LPOLECLIENTSITE, LONG, HWND,
                           LPCRECT);
                   STDMETHOD(EnumVerbs)(IEnumOLEVERB**);
                   STDMETHOD(Update)();
                   STDMETHOD(IsUpToDate)();
                   STDMETHOD(GetUserClassID)(CLSID*);
                   STDMETHOD(GetUserType)(DWORD, LPOLESTR*);
                   STDMETHOD(SetExtent)(DWORD, LPSIZEL);
                   STDMETHOD(GetExtent)(DWORD, LPSIZEL);
                   STDMETHOD(Advise)(LPADVISESINK, LPDWORD);
                   STDMETHOD(Unadvise)(DWORD);
                   STDMETHOD(EnumAdvise)(LPENUMSTATDATA*);
                   STDMETHOD(GetMiscStatus)(DWORD, LPDWORD);
                   STDMETHOD(SetColorScheme)(LPLOGPALETTE);
               END_INTERFACE_PART(MyOleObject)
    
          DECLARE_INTERFACE_MAP();
    						
    ??? ???? ??? ??????? XMyOleObject ??? ??? ???? ??????. ???? ?? ????? ??????? ??? ??????? ?????? ????? ??? ?? ??? ?????? ????? IUnknown ??? ??? ????? ?????? IUnknown ?????.
  2. ????? ????? IOleObject ??? ???? ????? ???? ?????? ?????? ????? ??? ????? INTERFACE_PART ??? ??? ????? ????? ??????:
          BEGIN_INTERFACE_MAP(CIOleOverCtrl, COleControl)
             INTERFACE_PART(CIOleOverCtrl, IID_IOleObject, MyOleObject)
          END_INTERFACE_MAP()
    						
    ??????? CIOleOverCtrl ?? ??? ???? ?????? ? MyOleObject ????? ???? ?????? ???? ????????? ????? IOleObject.
  3. ???? ?????? ?????? ??????? ???? ?? ???????. ?? ?????? ????????? ???????? ??????? ??? ??? ????? ????? ??????:
          STDMETHODIMP_(ULONG) CIOleOverCtrl::XMyOleObject::AddRef()
          {
              METHOD_MANAGE_STATE(CIOleOverCtrl, MyOleObject)
              ASSERT_VALID(pThis);
    
              return pThis->m_xOleObject.AddRef();
          }
    
          STDMETHODIMP_(ULONG) CIOleOverCtrl::XMyOleObject::Release()
          {
              METHOD_MANAGE_STATE(CIOleOverCtrl, MyOleObject)
              ASSERT_VALID(pThis);
    
              return pThis->m_xOleObject.Release ();
          }
    
          STDMETHODIMP CIOleOverCtrl::XMyOleObject::QueryInterface(
              REFIID iid, LPVOID far* ppvObj)
          {
              METHOD_MANAGE_STATE(CIOleOverCtrl, MyOleObject)
              ASSERT_VALID(pThis);
    
              return pThis->m_xOleObject.QueryInterface ( iid,  ppvObj);
          }
    
          STDMETHODIMP
          CIOleOverCtrl::XMyOleObject::SetClientSite(LPOLECLIENTSITE
          pClientSite)
          {
              METHOD_MANAGE_STATE(CIOleOverCtrl, MyOleObject)
                 ASSERT_VALID(pThis);
    
              return pThis->m_xOleObject.SetClientSite ( pClientSite );
          }
          ...
???? ???? ???????? ??? ??? CIOleOverCtrl ?? ??? ???? ?????? ??? ? XMyOleObject ?? ??? ????? ????????? ????? IOleObject ? ??? ???? m_xMyOleObject ?????? ????? I ?? ????? ??? m_x ????? ???? ????????.

???? ?? ??? ????? ????? ?????? ????????? ??? IOleObject ?????? ???????. ??? ????? ?? ???? ??? ??? ???????; ?? ????? ? ????? ????? ?????? ?? ?? ?????? ???????.

?????

??????? ?????? # 38 ? # 39.

???????

???? ???????: 141277 - ????? ??? ??????: 28/???? ??????/1435 - ??????: 3.1
????? ???
  • Microsoft Foundation Class Library 4.2, ????? ?????? ??:
    • Microsoft Visual C++ 2.0 Professional Edition
    • Microsoft Visual C++ 2.1
    • Microsoft Visual C++ 2.2
    • Microsoft Visual C++ 4.0 Standard Edition
    • Microsoft Visual C++ 5.0 Enterprise Edition
    • Microsoft Visual C++ 6.0 Enterprise Edition
    • Microsoft Visual C++ 5.0 Professional Edition
    • Microsoft Visual C++ 6.0 Professional Edition
    • Microsoft Visual C++, 32-bit Learning Edition 6.0
    • Microsoft Visual C++ .NET 2002 Standard Edition
    • Microsoft Visual C++ .NET 2003 Standard Edition
    • Microsoft Visual C++ 2005 Express Edition
????? ??????: 
kbnosurvey kbarchive kbmt kbarchitecture kbctrl kbhowto KB141277 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????141277

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com