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

?????? ????????? ?????? ?????????
???? ???????: 196776 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

????? ??? ??????? ?????? ??????? ??????? ???????? ??????? ??? Microsoft Office ?? Visual C++.

??????? ????

???? ???????

  1. ?? ??????? ?? "???????" ?
  2. ??? ???? ??????? ??? ?????? ????? ?? ????? ???? ?????? ??? ?????? ?? ????????? ?
  3. ?? ???? ??? ?????? ???? ??????? ???????
  4. ?? ??????? ?? "COM" ?
  5. ??? ?????? ??? ???? ????? Office ??? ??????? ?
  6. ????? ????? ???????? ??????????
  7. ????? ????? ??????? ???????? ?????? ??????? Office
  8. ??? "??????? ????????" ????? ?? ???? ????. ??? ???? ?????? ??????? ?
  9. ???? ???? ??? ????? ????? ???? ???-2147352573 ?? 0x80030002 ? ?
  10. ?? ??????? ?? "????? ???" ?
  11. ???? ???? ????????? ???????? "??????? ???????? ????? ?? ?? Microsoft Excel 95 ???? ??? ?? Microsoft Excel 97. ????? ????
  12. ????? ??????? ?????? ????? ??? ?? ??????? ??? ?????? ???????? ?
  13. ???? ?? ???????? ?????? ??????? ????? Microsoft Office ? ???? ??? ???? ???? ??? ??????? ???????? ????????? ?
  14. ???? ????? ????? Microsoft Office ???????
  15. ??? ?????? ?????? ??? ????? ??????? ????? ?? ?? ????? Microsoft Office

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

  1. ?? ??????? ?? "???????" ?

    ??????? ???????? (?????? ????? OLE) ?? ????? ???? ?? ??????? ????????? ?? ????? ?????? ????? ?????? ?? ????????? ?????? ??. ??? ???? ??????? ???? ??????? ?? Microsoft Word ??????? ???????? ??????? ????? ??? ??????? ???? Microsoft Word ????? ??????????. ????? ??????? ???? ????? ????? Microsoft Excel ????? ??????? ? ????????. ???? ????? ??? ??????? ???? ???? ?? ?????? ??????? ?????? ??.
  2. ??? ???? ??????? ??? ?????? ????? ?? ????? ???? ?????? ??? ?????? ?? ????????? ? 24 ????? ?? David Kruglinski "???? Visual C++" (ISBN:1 565 - 57231- - 2) ???? ???? ???? ??? ???? ???????? ??? ??? ??????? ?????. ??? ????? "????? ??????? ?? Microsoft" ???? ??? ?? ?????????. ????? ??? ?????? ???? ??? ???? ?? ????? ????? ?? ????? ???? ??? ?? ??????? ??????? ?? "????? ??????? ?? Microsoft:
    152023????? ???? ????? ??? ????? OLE ???????
    ??? ??? ???? ?????? ??? ?????? ?????? ?????? ??????? ??????? ?? "????? ??????? ?? Microsoft:
    179706??????? HOWTO MFC ?????? Excel & ?????/????? ???? ????
  3. ?? ???? ??? ?????? ???? ??????? ???????

    ???? ???? ??? ?????? ????? ??????? ???????: MFC ? #import ? C/C++:

    • MFC ? ??????? ClassWizard C++ Visual ?????? "??????" ???????"" ?? ?????? ??????? Microsoft Office. ??? ?????? ???????? ??? ???? ???? MFC COleVariant ???????? COleSafeArray COleException ? ????? ?????? ?????????. ???? ???? ??????? ????? ??? ?????? ???????? ???? ??????? ????? MFC.
    • #import ????? ???? ????? ?????? ?? 5.0 Visual C++ ? ???? VC ++ "?????? ??????" ?? ????? ??? ????. ??? ????? ???? ???? ?????? ??? ?????? ???? ?? ???? - counting ??????? ???? ???? ???? ??? ????????? ?? ??????? Microsoft Office.
    • ??? "?????" C/C++ ?????? ?? ??????? ???? ??????? ???????? ????? ????? ?? MFC ?? ????? #import. ???? ?????, ????? ?? ??? APIs ?? CoCreateInstance() ?? ?????? COM ??? IDispatch IUnknown.
    ?? ????? ?????? ??? ???? ??? ?????????? ???? ??? ??????? ?? C++ ?????? C ???? ???? ?? ????? COM ??? ??? C++. ????? ?? ?????????? ?????? ?????? ??????? ??????? ?? ????? ?????Microsoft ??? ???? ?????? C:
    181473HOWTO: ??????? ????? OLE ?? ??? ??????? C
  4. ?? ??????? ?? "COM" ?

    ????? ??????? ???????? ??? ???? ???? ?????? (COM). COM ????? ????? ?????? ???????? ??? ?????? ??? ????? ???? ??? ??? ??? ?????? ??????. ?????? ??? ???? ?????? ???? ????? ??? ??????? (OOP) ? ???? ??????? ????? ??? ?????????. ?? ???? ????? ?? ?????? ?? ?????? ? ???? ????????? ??? ???? ????? ??????? ???? ???????? ???? ??? ??? ????????.

    COM ????? ?????? ?? ??????? ???????? ?? ???? ?????? ???????? ?????? (DLLs) ??????? ?? ???? ???????. ?????? "??????? ????????" ?????? ?? ??? ???????. ?? ???? ???? "Marshalling" ???? ??? ????????? ????? ?????? ??? ????? ??? ?? ?????? ????? ?????? ?????? ??? ?? ???????? ?????? ??? ??? ????? ??????. ???? ??? ???? ????? ???????? ???????? ??? ?????? ?? ????? ????? ?????? ??? ?????? ????? ???? ?????? & .exe & ????? ?? ????? ??????? ?????? ??. ??????? ????? ???? ??? ??????? ?? ?????? ?????? ????? ??? ???? ??????? ? ????? ?? ???? ??????? ??????. ???? ?????? ?? ??????? ???????? ??????? ???? ??? ??????? ?? ??? ?????? COM ????????. ????? ????? ??????? ??? ??? "???? Ole - ??????? ??????" ??? Kraig Brockschmidt ISBN 1-55615-843-2 "???? COM" ?????? Rogerson ????? - ISBN 1-57231-349-8 ? ? "????? ?????? ????? ?????????" ISBN 1-57231-584-9.
  5. ??? ?????? ??? ???? ????? Office ??? ??????? ?

    ?????? GetActiveObject() API. ?????? ??????? ???????? ????? ?????? ?? ROT (????? ???? ????) ? ??? API RegisterActiveObject(). ????? ?????? ????? ??????? ???????? ?? ???? ??? ??????? ?? ??? ???:
          // Translate server ProgID into a CLSID. ClsidFromProgID
          // gets this information from the registry.
          CLSID clsid;
          CLSIDFromProgID(L"Excel.Application", &clsid);  
    
          // Get an interface to the running instance, if any..
          IUnknown *pUnk;
          HRESULT hr = GetActiveObject(clsid, NULL, (IUnknown**)&pUnk);
    
          ASSERT(!FAILED(hr));
    
          // Get IDispatch interface for Automation...
          IDispatch *pDisp;
          hr = pUnk->QueryInterface(IID_IDispatch, (void **)&pDisp);
          ASSERT(!FAILED(hr));
    
          // Release the no-longer-needed IUnknown...
          pUnk->Release();
    
    						
    ??????: ??? ?????? ?????? ??? ??????? ?? ????? Office ???? ???? ??????, ??? ????? ?????? ?????? ?????? ????? ???? ?? ?????? ???????? API GetActiveObject().

    ??????, ????? ????? ROT ??? ???? ??????? ???? ??????? Office ?? ????? ?????? ?? ???? ???? ??? ?????? ?? ROT ??? ???? ???????? ?????? ??? ???? ????? (??? ???? ???? ??????? ??? ??? ???) ???. ???? ???? ??? ?? ????? ????? ??? ?? ???? ??? ??????. ??? ???? ??? ??????? Office ????? ????? ????????? ?????? ??? ?? ROT ? ????? ????? ????? ???????? ?????? ?????? ???????? ????? ?????? ?? ?????? ??? ???? ??????? ??? ROT ???? ?? ????? ????. ???? ??? ???? ?? ???? ????? ??????? ???????? ?? ROT ? ????? ?? ??? ?????:
    190985HOWTO: ????? IDispatch Excel ?? ????? Word ?? OCX
    ?? ????? ??? ????? ??? ??????? PowerPoint? ???? ????? ???? ????; ???? ?? ???? ???? ??? ???? ???? ?? ???????.
  6. ????? ????? ???????? ??????????

    ????? ??? ???????? ???????? "??????????". ?? Visual Basic? ????? casually ??? ????? ??? ??????? ???????. ??? ???? ??? ??????? ?? Visual C++ ???? ?????? VARIANT ???? ????? .vt ????? ??? ?? VT_ERROR ??? ????? .scode DISP_E_PARAMNOTFOUND. ???:
          // VARIANT used in place of optional-parameters.
          VARIANT varOpt;
          varOpt.vt = VT_ERROR;
          varOpt.scode = DISP_E_PARAMNOTFOUND;
    						
    ??? ????? Visual Basic ?? behind-the-scenes.
  7. ????? ????? ??????? ???????? ?????? ??????? Office

    ???? ????? ???? ???? ?????? ????? ????? ???? ???? ?????? ("???? ??") ? ?? ????? ????? ??????? ????????? ?? ??????? ("??????"). ???? ??????? ??????? ????? ???? ????? ?? Microsoft Word:
    183599HOWTO: ?????? ????? ??????? Word97 Microsoft ??????? VC ++
    ???? ???? ?????? ????? ??????? ????????? ????? ?????? ??? ?????? IConnectionPointContainer ???????? FindConnectionPoint() ?? IID ????? ?????. ????? ??? ????? IConnectionPoint ????? ?? ?? ?? ???? ??? ??????? Advise() ?? ???? ????? ?????. ?????? ??? ?? ??? ??????? ??? ??? ??????? ??? ????? ??? ???????.
  8. ??? "??????? ????????" ????? ?? ???? ????. ??? ???? ?????? ??????? ?

    ??? ???? ????? ???? ??????? ?????? ???????? ???????? ?? ????????. ??? ????????? ??????? Excel ???????. ??? ???? ?? ???? ?? ??? ???????? ???? ????? ????? ?? ??????? ?? ??? ???? ???????? SAFEARRAY ???? ???????. ???? ?????? ????? ????? Microsoft ??????? ?????? ??? ???? ?? ??????? ?????? ??? ???????:
    186120HOWTO: ??????? MFC ????? Excel ? ????? ???? ?? ????
    186122HOWTO: ??????? MFC ????? Excel & ?????? ??? ???? ?? ????
    179706HOWTO: ??????? MFC ????? Excel "?" ?????/????? ???? ????
    ?????? ?? ????? ??? ?? ??????? ??????? ???? ??????? ????? ??????. ??? ???? ??????? ????? ??? ???????? ??? ??????? ?? ??????? "??????? ????????" ????? ?????? ????. ?? ????? ??????; ????? ?????? ??? ??? ??? ??????? ?????? ??? ??????? ????? ??.
  9. ???? ???? ??? ????? ????? ???? ???-2147352573 ?? 0x80030002 ?

    ??? ????? ????? HRESULTs ?? ?? ??????? ?? winerror.h. ???? ??????? ????? ???? ???? ???? ???? ????? ??? ????? ??? ?? ??. ????? ??????? ?????? ???????? ErrLook.Exe ???? ???? ?? Visual C++ ?????? ??? ??????? ??? ??? ??? ????.

    ??? ??? ???? ??????? ?????? ??? ??? ??????? ????? ??????? API FormatMessage(). ???? ?????? ????? ????? Microsoft ??????? ?????? ??? ???? ?? ??????? ?????? ??? ??????? FormatMessage():
    186063INFO: ??????? ????? ??????? ???????? ?? VB/VBA
    122957?????: Decode32 ? Decode16 OLE ???? ?? ????? ??? ??? ?????
    ??????: ??? ??? ?????? 6.0 Visual C++ ???? ???? ????? ????? ??? ??? ?????? ?? ???? ???????? ??????? ????? "? hr" (???? ?????? ??????) ??? ?? ????? Visual C++ ????? ??!
  10. ?? ??????? ?? "????? ???" ?

    ???? ????? ??? ??? ??? C/C++. ??? ????? ??? ?????? ???????? ???????? ???? ????? ??? ????. ????? ??? ????? ????? ?? "???? ????" OLE/COM (Oleview.exe) ???? ???? ?? Visual C++. ????? ??? ????? ????? ????? ????? ????? ?? Microsoft Office 95 ? 97 2000:
    
           Office Application      | Type library
           ------------------------+----------------
           Word 95 and prior       | wb70en32.tlb
           Excel 95 and prior      | xl5en32.olb
           Powerpoint 95 and prior | Powerpoint.tlb
           Access 95 and prior     | msaccess.tlb
           Binder 95               | binder.tlb
           Schedule+               | sp7en32.olb
           Project                 | pj4en32.olb
           Team Manager            | mstmgr1.olb
           Word 97                 | msword8.olb
           Excel 97                | excel8.olb
           Powerpoint 97           | msppt8.olb
           Access 97               | msacc8.olb
           Binder 97               | msbdr8.olb
           Graph 97                | graph8.olb
           Outlook 97              | msoutl8.olb
           Outlook 98              | msoutl85.olb
           Word 2000               | msword9.olb
           Excel 2000              | excel9.olb
           Powerpoint 2000         | msppt9.olb
           Access 2000             | msacc9.olb
           Outlook 2000            | msoutl9.olb
           Word 2002               | msword.olb
           Excel 2002              | excel.exe
           Powerpoint 2002         | msppt.olb
           Access 2002             | msacc.olb
           Outlook 2002            | msoutl.olb 
    
    
    						
  1. ????????? ???????? "??????? ???????? ????? ?? ?????? Excel 95 ???? ??? ?? Excel 97. ?? ???? ????

    ????? ?????? ?? Excel ????? ????? ???? ?? ??????? 95 ?? 97. ????? Excel 95 ???? ???????? ???????? ?????? ?? ?? ????? ???? ?? IDispatch. ??? ???? ?? ?????? ???? ?? ??????? ???????? ???? ????? X ?? ?? ???? ?. ??? ?? ??? ????? ??? ? ??? ?? Office 97 ?? ???? ?? ?????? ?? ??? Idispatch ???????. ???? ???? ??? ??? ???? ????? ?? ????? ?? ???? X ?? ?????? ?????? ? ? ????? ????? 0x80020003 ?-2147352573 ? "?? ??? ?????? ??? ???." ????? ??? ????? ????? ???? ?? ?? ????? IDispatch ??????? ????? ??????????? ??????? ?? semantically ??????. ???? ?????? ????? ????? Microsoft ??????? ????? ?? ?????????:
    172108"??? ?? ??? ?????? ???" ? 0x80020003 ??????? ????? HOWTO: ???
  2. ???? ??????? ?????? ????? ?? ??????? ??? ?????? ????????. ?? ???? ????

    ?????? ??? ??? ???? ?????? ????? ???????? ?????? ??? ????. ???? ??? ??? ?????????? ?????? ?? ??????? ???? ??:

    • ??? ??? ?????? #import ? ??? ??????? ???? ???? ?? ???? ??? ??????? ??? ??? ??????? ???? ???? ?????? ??. ???? ?????? ??????? ???? ?? ????? ??? ???? ????? ?????? ???????? ??? ?????? ???????. ?? ???? #import ???? ???? ??? ?? ??????? Office ?????? ?????? ??????? ???????? ??????. ?????? ??? ??? ??? ???????? counting ???? ?????? ????? ??? ???? ?? ????????? COM ????? ????? behind-the-scenes ??? ??????? #import.
    • ???? ?????? ?? ??? ??? ???????? ??? ?????? ??? ??? ?? ???? ? ???? ???? ?????? IDispatch * (LPDISPATCH) ? ????? ???? ???????. ??? ??? ??? ???? ??? abandoning ??? ??????? ???? ?? ??????? ?? ?????? ??? ????? ????????? ???????? ???? ???? ??? ????? ?? ???? ????? ?????.
    • ??????? ???????? ?????? ??? ????? ????????? ???????? ?????? ?? ??? ?? ??????? ????? ?? ?????? judiciously ????? ????? ???? ??? ???????.
    • ???? ?? ??? ????????? ????? ????? ??? ??? ???????? ??? "touched" ???????. ??? ??? ???? ????? ??? ????? ?? ??????? ??????? ?? ???? ????? ????? ???? ???. ??????? Office ????? ??? ????? "UserControl" ??? ???? ??????? ???? ???? ???? ???????/??????? ????? ??? ??????.
    • ?????? ???? ???? ??? ????????? ?????? ??? ??????? ??? ??? ????? ????? ???????? "?????". ??? ?? intending ?????? ???????, ?? ??????? ??????? Quit() ????? ?? ?? ???? ???????. ????? Word ????? ??????? ??? ????? ?? ??? ?????? ????? ?? ??? ??????? ?????. ??? ??? ???? COM ???????. Excel? ??? ????? ?? ???? ???? ???? ???? ??? ????? ???? ????? ??? ??? ??????? ??? ??? ????? ???? ???????? ???????. ???? ???? ????? ??? ????? ???? ??????? ??????? ?? ??????? Quit() ??? ??? ??? ???? ?? ????? ???????.
  3. ???? ?? ???????? ?????? ??????? ????? Office ? ???? ??? ???? ???? ??? ???? ????? ???? ??????? ?

    ?? ??? ?????? ?????? ??????? ????? ?? ????? ??? ???????. ???? ????? ????? ????? ?????? ?????? ???? ?? Word ?Excel Powerpoint ???????? ??? ?? ???? ?? ???? ??????? ? ?????? "???? ???????". ??? ???? Macro\ '"????? ????? ????"' ?? ??????? ????? ? ????? ?????? ???? ?????? ?? ???? Macro\ '"????? ???????"'. ????? ???????? ?? ???????? ???? Macro\Macros ?? ??????? "?????" ? ??? ????? ????? ??????? ???? ????? ? ?? ???? ??? ?????. ??? ?????? ??? ????????? ???????? ??????? VBA ???? ??? ????? ?????? ???? ??????. ?? ?? ???????? ??????? ??????? ?? ???? ??? ????? ?? ???? ??????? ????? ????? ?? ???? ??? ???? ??? ???? ?????? ?????.
  4. ???? ????? ????? Office ???????

    ??? ??????. ??? ?????? ??? ?????? ?????? IDispatch: ??? ???? ?? Visual C++ ?????? ?????? 39 (TN039). ???? ????? ????? ????? Microsoft ??????? ??? ???? ?????? ???? ?????:
    184663HOWTO: ????? ? ????? ???? ??? Microsoft Excel ?? MFC
  5. ??? ?????? ?????? ??? ????? ??????? ????? ?? ?? ????? Office

    ????? ??????? ????? ?? ???? ??????? ?? ?????? ?? ???? IPropertyStorage. ?????? "????? ??????? ?? Microsoft" ??????? ??? ?? ?????:
    179494HOWTO: ??????? ??????? ???????? ????? ??????? ?????
    186898HOWTO: ????? ??????? ??????? ?????? ?? VC ++ ?????

???????

???? ???????: 196776 - ????? ??? ??????: 05/???? ?????/1429 - ??????: 7.0
????? ???
  • Microsoft Visual C++ 2008 Express Edition
  • Microsoft Project 2000 Standard Edition
  • Microsoft Excel 2000 Standard Edition
  • 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 Access 97 Standard Edition
  • Microsoft Excel 97 Standard Edition
  • Microsoft PowerPoint 97 Standard Edition
  • Microsoft Outlook 97 Standard Edition
  • Microsoft Word 97 Standard Edition
  • Microsoft Access 2000 Standard Edition
  • Microsoft PowerPoint 2000 Standard Edition
  • Microsoft Outlook 2000
  • Microsoft Word 2000 Standard Edition
  • Microsoft Access 2002 Standard Edition
  • Microsoft Excel 2002 Standard Edition
  • Microsoft PowerPoint 2002 Standard Edition
  • Microsoft Word 2002 Standard Edition
  • Microsoft Outlook 2002 Standard Edition
????? ??????: 
kbmt kbsweptvs2008 kbautomation kbfaq KB196776 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????196776

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

 

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