????? C++ .NET ?? ??????? ?? Office ?? ??? ??? ?????? ????????? ?? ????? ???? ????

???? ?????? ???? ??????
???? ID: 307473 - ?? ???????? ?? ?????? ??? ?? ?? ???? ???? ???? ??.
??? ?? ??????? ???? | ??? ?? ??????? ????

??????

?? ???? ????? ?? ?? ???? ?? ????? C++ .NET ????? ?? ??? ????????? ??? ???????? ???? (COM) ?????? ??? ??????????? ?? ??? ??? ??????? ??????? ?? ??? ??? ????? ???? ??? ?? ??? ??? ????? ????? Microsoft ????????? ???? (MFC) ???? wrappers ?? ??? ??? Office ??? ?? ????

???? ???????

????? ????? ?? ???? demonstrate ???? ?? ?????? ??????? ??????? ?? ????? ?? ??? ??? ?? ????????? ???? ?? ??? ??? ????? ??? ???:
  1. ??????? ??????? ??????
  2. Microsoft Excel ?? ???????? ???? ?? ??? ??? ???????
  3. ??????? ??????? ?? ??????
???? ??? ???, ?? ????? ?? ???? ???, ??? ??? ??????? ????? ?? ??? ???? ?? ????? ?? ??? ??? ?? ??????? ????? ???????? ????? ???Microsoft Excel ?? ???????? ???? ?? ??? ??? ??????, ??????? ????? ?? ??? ??????? ???

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

  1. Microsoft Visual Studio .NET ???? ????.. ????? ???????????? ??,????? ????-????? ????, ?? ???? ????????????. ??? ????MFC ?????????????? C++ ????????? ??????, ?? ???? ??? ????????? ??? ?? AutoProject.
  2. ?? MFC ????????? ??????? ????? ???? ??, ????? ????????????? ?? ??????, ????????? ?????? ?? ??? ??? ?????????? ??????? ????-????? ????, ?? ???? ?????????.
  3. ??????? ????IDD_AUTOPROJECT_DIALOG????? ??????????? ?????:
    1. ??????????????????? (IDC_STATIC) ?????? ??????? (IDCANCEL)?
    2. ?? ID ????????? ????OK"IDRUN" ?? "?????." ???? ?? ??? ?????? ?? ??? ???
  4. ????? ???? wrappers ??????? ????? ?? ??? ?????? ????????? ?? ?? ??? ???:
    1. ?????? Explorer ???, ???? ?????AutoProject?? ????-????? ????, ?? ???? ???????? ??????.
    2. ????? ????,Typelib ?? MFC ?????? ????-????? ????, ?? ???? ????????.
    3. ????? ????,?? ???? ?? ?????: ?????????, ???? ??????? ?? ??? ??????? ?????? ????????? ?? ?????? ????? ?? ??????

      ?? ?????? ?? ??? Microsoft ExcelXP ?? "Microsoft Excel 9.0 ?????? ?????????" Microsoft Excel 2000 ?? ??? ?? ??? "Microsoft Excel 10.0 ?????? ?????????" ?? ??? ?????
    4. ???? ??? ?? ?? ???? interface(s) ?? ??? ????, ?? ???? ??? ???? (>) ??????? ?? ??? ?? MFC ????? wrappers ?? ???? ??? ????? ?????? ?? ??? ?????? ?? ????? ????? ????? ????,???????? ?? ??? ??????? ????? ???

      ?? ?????? ?? ??? ???? ????_Application???????? ???

      ????????????? ???? ?????? ???? ?? ?????? ????????? ??? ?? ???????? ???, ???? ?? ???????? MFC ???????? ????? ??????? ?? ??? ?? ??? ????? ??? ???? ????? ????? ??????? ????? ????? ?? ?? ??? ????? ???? ??????? ??? ????, ?????? ?? ???????? overhead ?? ????? ????? ?? compilation ?? ????? ?????? ?? ???? ????
  5. ??? ???? ?? ??? COM ?????? ????????? ?? ????? ????CAutoProjectApp::InitInstance?????? ?? ???, ????? ??? ??????:
    if(!AfxOleInit())  // Your addition starts here.
    {
      AfxMessageBox("Cannot initialize COM dll");
      return FALSE;
      // End of your addition.
    }
    
    AfxEnableControlContainer();
    					
  6. ??????? ????? ?? ?????? ????????? ??? ??????? ?? ????? ?? ?? ?? ???????? ????? ??? ???? ?? ??? ??? ???????? directive ??????? AutoProjectDlg.cpp ?? ????? ?? Stdafx.h ?? ??? ???????? ??? ?? ??? directives ???????

    ?? ?????? ?? ??? CApplication.h ????? ??? ???? ?? ???, ?? ??? ????? ???? ??? ?? ?? ???? ???????? ??????_Application??????? ?? ???:
          #include "stdafx.h"
          #include "CApplication.h"
    					

Microsoft Excel ?? ???????? ???? ?? ??? ??? ??????

?????IDD_AUTOPROJECT_DIALOG????? ????? ???, ????-????? ??????????? ????-????? ????, ?? ???? ???????? ?????? ???????? ?????-???? ???? ????? ???? ????? ?????? ??????? ??? ?? ??? ????BN_CLICKED?????? ?? ????? ??, ?? ???? ????????? ?? ??????. ?????? ??? Excel ?? ???????? ???? ?? ??? ????? ??? ??????:
void CAutoProjectDlg::OnBnClickedRun()
{
   CApplication app;  // app is the Excel _Application object

   // Start Excel and get Application object.

   if(!app.CreateDispatch("Excel.Application"))
   {
      AfxMessageBox("Cannot start Excel and get Application object.");
      return;
   }
   else
   {
      //Make the application visible and give the user control of
      //Microsoft Excel.
      app.put_Visible(TRUE);
      app.put_UserControl(TRUE);
   }
} 
				

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

????? ?? ??????? ??????? ????? ?? ??? F5 ????? ?????? ????? ????? ????? ???? ??, ?? ????? ?????????. ??????? ??????? Excel ??????? ?? ???? ?? ?? ?? ????????? ?? ????? ???? ???? ????? ??? ????? ??? ?? Excel ??????? ??????? ?????????? ????????? ?? ???????? ???? ??? ?? ??????? ?????? ???? ?? ?? ???? ???? ???

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

???? ?????? ???? ??? ???? ???? ?????? ????????? ?? ???? ????????? ?? ???, ?? ??? ?? ???? ????????? ?? ???? ????? ??? ????? ?? ????? ?? ???? ?? ???? ?????, ??? ?? ?? ???? ??? ?? ???? ?? ??????? ????? ?? ??? ?? ????? ?? ???-????? ????, ?? ??? ???? MFC ???? ?? ??????????? ????? ??? ?? ????? ?? ??????? ?? ????? ?? ??? ???-????? ????? ??? ?? ???? ?????? ?? ????? ?? ???? ???? ????? ??? ?? ??? ???? ??? ?????? ?? ?? ??????????? ????????? ???? ?????? ??, ?? ?? ??? ????? ?????? ?? ??????? ??? ???? ????

???? ??? ??? Microsoft Excel ?? ???????? ???? ?? ??? ???? illustrate, ?????? ?? ???? ??????????? ?? ???????? ???? ?? ??? ?? ?? ???? ???? ?? ???? ???? ????? ???? ??? ???? Microsoft Office ??????????? ?? ?????? ????????? ?? ??? ????? ?? ??? ??:
?? ?????? ?? ??????? ?????? ?????? ?? ??????? ????
??????????????? ?????????
Microsoft Access 97Msacc8.olb
3.5 Microsoft Jet ???????DAO350.dll
Microsoft ?????? 97Msbdr8.olb
Microsoft Excel 97Excel8.olb
Microsoft Graph 97Graph8.olb
Microsoft Office 97Mso97.dll
Microsoft Outlook 97Msoutl97.olb
Microsoft PowerPoint 97Msppt8.olb
Microsoft Word 97Msword8.olb
Microsoft Access 2000Msacc9.olb
Microsoft Jet ??????? 3.51DAO360.dll
Microsoft ?????? 2000Msbdr9.olb
Microsoft Excel 2000Excel9.olb
Microsoft Graph 2000Graph9.olb
Microsoft Office 2000Mso9.dll
Microsoft Outlook 2000:Msoutl9.olb
Microsoft PowerPoint 2000Msppt9.olb
Microsoft Word 2000Msword9.olb
Microsoft Access 2002Msacc.olb
Microsoft Excel 2002Excel.exe
Microsoft Graph 2002Graph.exe
Microsoft Office 2002Mso.dll
Microsoft Outlook 2002MSOutl.olb
Microsoft PowerPoint 2002MSPpt.olb
Microsoft Word 2002MSWord.olb
Microsoft Office Access 2003Msacc.olb
Microsoft Office Excel 2003Excel.exe
????? Microsoft Office 2003Graph.exe
Microsoft Office 2003Mso.dll
Microsoft Office Outlook 2003:MSOutl.olb
Microsoft Office PowerPoint 2003MSPpt.olb
Microsoft Office Word 2003MSWord.olb
Microsoft Office Access 2007Msacc.olb
Microsoft Office Excel 2007Excel.exe
????? Microsoft Office 2007Graph.exe
2007 Microsoft OfficeMso.dll
Microsoft Office Outlook 2007MSOutl.olb
Microsoft Office PowerPoint 2007MSPpt.olb
Microsoft Office Word 2007MSWord.olb
???:?? ?????? ????????? ?? ??? ??????? ????? ??:
?? ?????? ?? ??????? ?????? ?????? ?? ??????? ????
Office ?? ?????????
Office 97C:\Program Files\Microsoft Office\Office
Office 2000C:\Program Files\Microsoft Office\Office
Office XPC:\Program Files\Microsoft Office\Office10
Office 2003C:\Program Files\Microsoft Office\Office11
2007 OfficeC:\Program Files\Microsoft Office\OFFICE12
Dao350.dll ?? Dao360.dll ?? ??? ??????? ????? ?? C:\Program Files\Common Files\Microsoft Shared\Dao ???

??????

????? C++ .NET ?? ???? ??? ???? ??????? ??????? ?? ??? ????? Usenet ?????? ???? ?????:
Microsoft.public.dotnet.languages.VC
Visual C++ .NET ?????? ?????? ?? ????? Microsoft ??? ???? ?? ????:
HTTP://support.Microsoft.com/default.aspx?xmlid=fh%3BEN-US%3Bvcnet

???

???? ID: 307473 - ????? ???????: 06 ??????? 2011 - ??????: 3.0
???? ???? ???? ??:
  • Microsoft Visual C++ .NET 2002 Standard Edition
  • Microsoft Office Professional 2007
  • Microsoft Office Professional Edition 2003
  • Microsoft Office XP Developer Edition
  • Microsoft Office 2000 Developer Edition
  • Microsoft Office 97 Developer Edition
??????: 
kbexpertiseinter kbautomation kbhowto kbnewsgrouplink kbmt KB307473 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:307473

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

 

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