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

?????? ????????? ?????? ?????????
???? ???????: 245115 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

????? ??? ??? ???? ????? ???? ?? ???? ??? ?????? ?? ??????? ?? ?????? ??? maintainability ????? ???????.

??? ?????? ???? ????? ????? ?????? ??????? ??????? ??? weighs ?? ?? ???? ?? ?????.

??????? ????

??????? ???????? ?? ????? ?/??? ???? ?????? ???? ???? ?? ?? ????? ???? ?????? ??? ???????? Microsoft ???? ???? ?????? (COM). ?? ???? ????? ?????? ??? ???? ????????? ?? ???? ??? Visual Basic ?? Visual Basic for Applications ?? ???? ??? ????? ?? ???? ???????.

?? ???? ???????? ???? ????? ?? ?? ???? ???? IDispatch ?? ???????. ???? ??? ??????? ??????? ??? ??????? ???????? ??????? ?? ??? ??????? ???? ?????? ??? ????? ?????? ???? ???? ???? ?? ?? ??? ???????; ???? ????? ????? ???????. ?????? ??? ???? ????? ???? ????? ???? ??????? ??????? ?? ???? COM ??? ??? ???? ?? ????? IDispatch (? ????? ????? ??????? ???). ????? ??? ??????? ???? ??? ????? ????? ??? ????????? ?????.

?? ?? ????? ?

??? ????? ????????? ????????? ???? ????? ?? ??????? ?? ??? ????? ??? ??????? (????? ?? ?????) ???? ???? ?????? ??????. ?? ??? ????? ??????? ??? ??? ???? ????? ???? ?? ????????? ???????? ??? ????? ????????? ????????.

???? ??????? ?????? "????????" ?? ??? ????. ???? ????????? ???????? ???? ???? ???? ??? ?? ???? ????? ??? ????? ??? ?? ??? "?????? ????? 12 ? ?????? x ?????? ??? ???? ?? ????????." ?? ???? ?? ??? ?????? ??? ???????? ?? ?????? ??? ??? ???? ????? ?????? ???, ??? ?? ???? ?????? ???? ????? ???? ???? ?? ????? ??? ?????? ?????? ?? ??????. ????? ???? "???" ??? ?? ????? ?????? ??? ????? ???? ?? ??????.

???? ??? ???????. ????????? ???????? ????? ?? ??????? ???? ????? ??? ??? ???? ??? ???????? ???????? ???? ?? ???? "?????." ??? ??? ????? ??????? ?????? ????? ?????? ??????? (?? ???????? ??????? ????? ???? ???) ??? ???????? ???????? ????? "???????? ???" ????? ??? ??????? ??????. ?????? COM ??????? ????? ????? ?? ???? ?????? (???? ???? V) ??????? ?? ??? ??????. ??? ???? ???? COM ?????? ???? v-??????.

???? ???? COM ??? ????. ??? ????????? ???????? ?????? ?? ????? ??? ???? ??? ???? ????? ???? ??? ????? ??? ???? ?????? v. V-?????? ????? ?? ???? ?????? ??????? ???? ?? ????? ???? ?????? ???? ??????? ??? ??? ??????. ??????? ???? ?????? ??? ???? COM ? ???????? ??? ???? ????? ??????? ?? ?????? ?? ?? ???????? ??? ???? ??????? ????? ????. ???? ?????? ????????? ???????? ?????? ????? ?????? ? ??? ?????? ??? ?????? ????? ????? ????? ?????? ?? ????????? ????????.

+-[Code]------------+  +.................................[COM Object]...+
|                   |  : +-------------+                                :
|Set obj = Nothing -|--->| obj pointer |                                :
|                   |  : +-|-----------+                                :
+-------------------+  :   |   +-----------------+                      :
                       :   +-->| v-table pointer |                      :
                       :       +--|--------------+                      :
                       :          |                                     :
                       :          |  +----------------------------+     :
                       :  (3rd)   |  | Function 1 Address pointer |     :
                       : (Offset) |  +----------------------------+     :
                       :          |  | Function 2 Address pointer |     :
                       :          |  +----------------------------+     :
                       :          +->| Function 3 Address pointer |     :
                       :             +----------------------------+     :
                       +................................................+

				
???? ?????? ????? ?? ???? ??? ????? ???? COM. ??? ???? ?????? COM ??? IUnknown ? ?? ??? ????? ??????? ?? ?????? ???????? ??? IUnknown. ??? ?????? ??? ????? ???? ??????? ????????? ???????? ?????? ?????? ?? v-?????? (IUnknown::Release).

????? ????? ??? ????? ????? ??? ?????? Visual Basic ?? ???????. ??? ??????? Visual Basic ???? ?????? ??????? ?? v-???? ??????. ???? ??? ???? ??? ???? ?????? ?????? COM ???? ??? ????? ??? ??????? ??? ??? ?? ?? ?????.

????? ??????

?????? ????? ?? ???????? ??? ???? (?? ???? V) ?????. ????? ?????? COM ?? ??? ????? ?? ???? ????? ????? ??? ??????? ????? IUnknown ???? COM. ???? ???? ?? ??????? ?????? ?????? ? ????? ??????? ???? ?? ????? ????? ?? ??????? ????? ?????? ?? ??? ?? ??????? ??????? ???? ????? ????? ????? ??? ????. ??? ??? ??? ?????? ?? ??????? ?? ?????? v ??? ????? ????? ?????? ?????? ???????? ??????? ??? ?

????? ??????? ? ??????? ??? ?? ?? ???? ?????? ???? ???? ???? ?????? v-??????. ??? ??? ????? ????? ????? ??? ????? ????? ?????? ??? ?????? ????? ?????? ??? ???? ?????? IUnknown ????? ??. ??? ?? ???? ??? ???? ?????? "?????? - ????????."

???????? ????? ?????? ??? ???? ????? ??? ????? ???? ???? ???? v-???? ????? ??. ?? Visual Basic? ????? ?????? ???? ?? ???? ????? ???? ??? ????? ??? ??? ?????? ????? ?????? ?? (v-??????) ???? ??????? ???? ???? ????????? ??? ??????. ????? ???? ??? ????? ????? ???? ??? ??? ????? ?? ????? ???????? ??? ?????? ???????? ???? v. ??? ???? ??????? ??? ???? ????? Microsoft Office Excel ???????? ????? ?????? ?????? ???? ??? "Microsoft Excel 8.0 ???? ?????" ?? ???? ?????? Project|References ? ?? ???? ?????? ????? ??? ?? ????? "Excel.Application." ?? ?? ??????? ???? ????????? ???? ?? ??????? ??? ????? ???? ?? ???? ?????? ????:
' Set reference to 'Microsoft Excel 8.0 Object Library' in
' the Project|References dialog (or Tools|References for VB4 or VBA).

' Declare the object as an early-bound object
  Dim oExcel As Excel.Application

  Set oExcel = CreateObject("Excel.Application")

' The Visible property is called via the v-table
  oExcel.Visible = True
				
??? ??????? ???? ???? ????? ??? ???? ???? ??? ??? ?? ???? ?????? ?????? ???? ??????? ?? ??? ??????? ? ??? ???? ??????? ???? ???? ??? ???? ????? ??? ?????? ??? ??????? ?????? ?? Excel ?? ???? ??? ???? "??? ?????" ?????? ?

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

????? COM IDispatch. ???????? ???? ???? ?????? IDispatch ????? dispinterface (??? ??? ????? ??? ???? ?????) ?? ????? ?????? (??? ??? ??? ????? ????? ?????? ????? ????? ???). ????? ??? IDispatch ????? "??????? ???" ???? ??? ????? ??????? ?????? ?? ??? ??????? ????? ?? ??? ??????? ???????? ?????? IDispatch ?????? ???????. ?????? ??? ?????? ???? ???????, ?????? ??? ??? ??? ????? ????? ??????? ??? ???? ????????? ??? ???? "????? ??"??? ?????? ??"????? ?????" ????? ?? ?????? ???? ?????? ????? ???? ?? ????.

??? ?????? ?????? ??????? ?????? ????? ?????: GetIDsOfNames ?? ???????. ????? ?????? ?????? ????? (?????) ??? ????? (???? ??? dispid) ???? ???? ??????. ????? ????? ?? ?????? ???? ???? ??????? ?? ????? ????? ?????? ???????? ?????? ???????. ???? ??? ????? ?? ??????? ??????? "???????? ???????."

??? ????? ?? Visual Basic ????? ????? ????? ??? ?????? ?????? ????? ??????. ??? ??? ?????? ????? ???? ?? "????" ???? ?? ? ?? ??????? ???? Visual Basic ???????? IDispatch ? ???? ???????? ????? ???????:
' No reference to a type library is needed to use late binding.
' As long as the object supports IDispatch, the method can 
' be dynamically located and invoked at run-time.

' Declare the object as a late-bound object
  Dim oExcel As Object

  Set oExcel = CreateObject("Excel.Application")

' The Visible property is called via IDispatch
  oExcel.Visible = True
				
??? ????? ?????? ???? ????????? ???????? ?? ????. ???????? ?????? ??? ????? ?????? "?" ????? ??????? (????? ??? ???????) ?? ????? ?????.

?? ????? ?????? ?? ?? "??????? ?????" ??? ???? ??????? ???? ???? ??? ??????? ???? ??? ???? ??????. ??? ?? ????? ?? ???????? ??????? ??? ????? ???? ??? ??? IDispatch ???? "?????? ??????:" ??? ?? ?? ??? ???? ??? Visual Basic ??????? ????? ??????? ??????? ?? ???? ????? ???? V (IDispatch::Invoke) ??? ??? ?? ??????? COM. ???? COM ???? ??????? ?? ????? ????? ??????? ?????? ?????? ???? Excel ?????. ???? ??? indirection ?????? Visual Basic ?? ??? ??????? ??????? (????? ? ????? ???? ????) ???? ?? ???? ?? ???? ?????? ?????? ?????? ?????? ?????.

??? Dispid

????? ??? ??????? (?????? noticeably MFC ? 3.0 Visual Basic ??? ????? Visual Basic 6.0 "?" 5.0 ?? ?????? ??? ????? ???? ActiveX) ??????? ????? ????? ?? ??? ????? ????? ??????? ????? dispid. ??? ???? ???? COM ?? ??? ??????? ???? ??????? ?????? dispids ??????? ???? ???? ?????? ????? ?????? ??? IDispatch::Invoke ??? ?????? ??? ??????? GetIDsOfNames ?? ??? ???????. ??? ???? ???? ???? ????? ???? ??? ????? ?? ????? ??????? COM ????? ??? ???? ? ????? ??? ??? ??? ???.

????? Dispid ??? ?????? ????? ?????? ???? ???? ?? Visual Basic 5.0 ?? 6.0. ?????? ???????? ???? ??? ??????? ????? ?? ????? ??????? ???? ?? ????? ??? ????? ????? (??? ?? ???????? ???? ????? ??? dispinterface) ?????? ??? ????? ????? ???? ActiveX ???? ? ?????? ???? ???? Visual Basic ????? ?????? ?? ???? ??????? ????? ????? dispid.

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

????? ????? ??? ?????? ??? ?? ????? ??????? ?? ?? ??? ???. ???? Microsoft ????? ?????? ?? ??????? ???? ???????. ??? ???? ?? ???? ???? ????? ?????? ????? ???????.

????? ?????? ?? ??????? ??????. ???? ??? performer ???? ???? ???? ??????? ????? ?? ??????? ??? ????? ??? ??????? ???? ??? ???? ?? ????? ??? ????? ?? ????? ??? ??? ???????. ?? ??? ???? ??????? ????? ??? ????? ????? ??? ?????? ?? ????? ???????.

????? ?????? ??? ???? ???? ???. ??? ???? ???? ????? ??? ????? ????? ??????? Visual Basic ????? ????? IntelliSense ???????? ?? ????????? ???????? ?? ???? ???? ????. Visual Basic ????? ????? ??? ??? ??? ???????? ?? ????? ?? ???? ??????? ??? ????? ??? ???? ?? ????? ??? ????? ????? ????????? ????????.

????? ??????? ???? ?? ???? ?? ??????? ??? ????? ?????? ?? ???? ??? ????? ?? ??? ???????. ??? ??? ??????? ????? ?? seeks ??? ?????? ?? ??? ?????? ??? ????? ?? ????? ??? ??????? ????? ??? ????? (???????? ???? Visual Basic 6.0 CallByName ??? ???? ??????) ?? ????? ??? ??????? ????? ???????. ????? ???? ????? ??????? ??????? ?? ????? ??????? ??? ??????? ?????? ?? ???? ????? ?? ??????? ????? ?????? ?? ??? ????????? ?? ???? ?????? ???? ??? ????.

????? ?????? ????? ?????? ???? ???? ?????? ???? ???? ???.

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

??? ??? ????? ???????? ???? ????? ????? ?? ?????? ??????? ??? ?? ???? ?????? ?? ??????? ?????? ???? ??? ???? ??????? ?? ??? ??????? "? ??? ?? ??? ???????? ???? ????? ?????? ??? ????? ??????? ?? ???? ????????? ?????? ?? (?? ??? ???????) ??????? ????? ??????? ??????? ????? ???? ?? ?????? ?? ????? ???? ???? ????? ?? ???? ??? ???? ??? ??????? ?? ??????? ?????? ??? ???? ??????.

???? ??????? Microsoft Office ???? ??? ?????? COM. ??? ????? ????? ??????? Office ???????? ?????? ??? ??? ????? ????? ????? ?? shortcomings ??????? ?????? ??? ?????????. ??? ??? ????? ?????? ??? ??????? Office ?? ???????? ?? ?????? ??? ????? ???? ?? ?????? ???? ??????? ?? ???? ????? ??? ?????? ????? ?? ??????. ??? ???? ??????? ??? ???? ?? ???? ?????? ??? ????? Excel 95 ? Excel 97 ?Excel 2000 ? Excel 2002 ??? ???? ??????? ????? ????? ?? Excel 95 (XL5en32.olb) ?????? ??? ??????? ?? ???? ????????? ???????.

???? ??????? Office ????? ???? ????? ???? ?????? (?????? ???? ??????? ????? ????) ????? ???? ?? ??????? ??? ??? ??????? ????????. ?????? ??? ????????? ???????? ?????? ?? ????? ???? ???? ??? ???? ??????? ???????? ?????? IDispatch. ?????? ??? ???? ?? ????????? ??? ?????? ??? ??????? ??? ????? ?? Office ?????????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
247579??????? ????? DISPID ?????? ??????? Office ???? ???? ???

?????

????? ?? ????????? ??? COM v-??????? ???????? ??????? ????????? ?????? ?????? ????? ???????:
Rogerson ????? ? ISBN ???? COM ? MSPRESS ?: 1-57231-349-8.

Curland ? DevelopMentor ????? ?????? Visual Basic 6 ? 0201707128.

???????

???? ???????: 245115 - ????? ??? ??????: 24/???? ??????/1428 - ??????: 7.2
????? ???
  • Microsoft Office Ultimate 2007
  • Microsoft Office Enterprise 2007
  • Microsoft Office Professional 2007
  • Microsoft Office Professional Plus 2007
  • Microsoft Office Standard 2007
  • Microsoft Office Home and Student 2007
  • Microsoft Office Basic 2007
  • Microsoft Office 2003, All Editions
  • Microsoft Office XP Developer Edition
  • Microsoft Office 2000 Developer Edition
  • Microsoft Visual Basic 5.0 Professional Edition
  • Microsoft Visual Basic 6.0 Professional Edition
  • Microsoft Visual Basic 5.0 Enterprise Edition
  • Microsoft Visual Basic Enterprise Edition for Windows 6.0
????? ??????: 
kbmt kbautomation kbinfo KB245115 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????245115

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

 

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