????? ??????? ????????? ????? #import ??? ???? ?? Visual C++

?????? ????????? ?????? ?????????
???? ???????: 175784 - ??? ???????? ???? ????? ????? ??? ???????.
??? ????? ??? ???????. ????? "??? ??" ??? ??? ??????? ??? ????.
?????? Microsoft Visual C++ .NET 2002 Microsoft Visual C++ .NET 2003 ???? ?? ?? ???? ????????? ???????? ??????? ???? ?? ??????? ?? ??? Microsoft .NET Framework ? ????? ????????? ???????? ??? ???????? Microsoft Windows ??????. ????? ????????? ??????? ?? ??? ??????? ??? ??? ????????? ???????? ??? ???????? Visual C++.????? Microsoft Visual C++ 2005 ????? ????????? ???????? ??????? ???? ?? ??????? ?? ??? Microsoft .NET Framework ?????? ????? ????????? ???????? ??? ???????? Microsoft Windows ??????.
????? ???? | ?? ????

??????

??????? #import ?????? ????? ?????? ???? ????????? ?????? ???? ??? ??????? _com_error ????? ????? ????? ??????? ?????? HRESULT ?????. ?? ???? ???? ????? ????? ???????? ??? ?????? ??????? ????? ??.

??????? ????

???? ??????? ??????? #import ??? ??? ???? ??? ??? ??????? HRESULTS ???????. ?????? ??????? ???? raw_interfaces_only ?? ??????? #import. ??? ????? ?? ???? ??? negates ??? ????? ???? ??????? ???? ???? #import.

????? ?????? ?????? ????? ????? ????? ?? ?????? ??? _com_raise_error ??? ????? ??????? ?????? ? ?????????? ???????:
void __stdcall _com_raise_error(HRESULT hr, IErrorInfo* perrinfo = 0)
   throw(_com_error);

   void __stdcall
   _com_raise_error(HRESULT hr, IErrorInfo* perrinfo ) throw(_com_error)
   {
       throw _com_error(hr, perrinfo);
   } 
				
?? ????? ??? ?????? ???? ?? ??? ????? ?? ??? COMDEF.H. ??? ??? ?????? ??????? ????? ?? ?? .OBJ linker ?????? ???? ????? ??? ????? ?? COMSUPP.LIB. ???? _com_raise_error ?? ?????? ?? COMSUPP.LIB ??? ??? ??? ???? ????????? ?????? ?????? ????????? ???????? ?????? ??.

???? ???? ????? ???? raising ????????? ????? #import:
??????: ?????? ?????? ??????? ??????? ????? ??? ?????? ??????? ???? - ??????? ????? ?????? ???????:
????? C4290: C++ "??????? ???????" ?????.
????? C++ whitepaper ??? ?? ????? ???? ??? ??? ??????? - ??????? ? ???? ????????? ??? ?? ??? View definition, ?? ?????? ????? ??? ??? ??????? - ??????? ???????? ??? ?????? ?????? ???.
void __stdcall
   _com_raise_error(HRESULT hr, IErrorInfo* perrinfo ) throw(_com_error)
       {
           //this message box is for demonstration purpose only
          AfxMessageBox( "_com_raise_error (HRESULT, IErrorInfo*)" );
           //your own error handling code or just an abort
       }
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF", "adoEOF" )

       _bstr_t     bstrEmpty(L"");
       _ConnectionPtr  Conn1 = NULL;
       Conn1.CreateInstance( __uuidof( Connection ) );
       Conn1->Open( bstrEmpty, bstrEmpty, bstrEmpty,0 ); 
					
????? ??? ???????? ???????? ?? ??? ???? ????? ADO ??? ????? ?? ??????? ????? ????. ???????? _com_raise_error ????? ??? _com_error ??? ????? ?????.

??? ???? ??? ???? ?? ??????? ??? ???????, ?? ?? ???? ????? ??? ?????? ???????????. ?? ???? ???????? ????? ????????? ???????? ???????? ?????.
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF", "adoEOF" )
    _ConnectionPtr  Conn1 = NULL;
    // Conn1.CreateInstance( __uuidof( Connection ) );
    Conn1->Open( bstrEmpty, bstrEmpty, bstrEmpty ,0); 
				
?? ??? ??????? Conn1 ??? ???? ???? ??? ???? ????? ??? ??? ?????? ??? ????? NULL ???? _com_raise_erro ??? ???????. ??? ????-> overloaded ???? ??????? ??? ????? ??????? ????? ????? ??? ?????? ??????? ?? ????? ??????? ??????? Open() ??? ???? ??? ??????? Win32. ???? Conn1 ???????? ?? NULL ????? ??? ??????? Open() ??? ?????????.

???????

???? ???????: 175784 - ????? ??? ??????: 24/???? ??????/1435 - ??????: 5.0
????? ???
  • Microsoft Visual C++ 2005 Express Edition
  • Microsoft Visual C++ .NET 2003 Standard Edition
  • Microsoft Visual C++ .NET 2002 Standard Edition
  • Microsoft Visual C++ 6.0 Enterprise Edition
  • Microsoft Visual C++ 6.0 Professional Edition
  • Microsoft Visual C++, 32-bit Learning Edition 6.0
  • Microsoft Visual C++ 5.0 Enterprise Edition
  • Microsoft Visual C++ 5.0 Professional Edition
????? ??????: 
kbnosurvey kbarchive kbmt kbhowto kbdatabase kbinfo KB175784 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????175784

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