??????? ???????? ?? ??? ????? ?????? OLE

?????? ????????? ?????? ?????????
???? ???????: 140346 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

OLE ????? ?????? ???? ????? ???????? Visual C++ ?? ??????? "?????" ? ?? "????? ??????" ???????? ?? ?????? ????? Kit (????????) ? ?? ???????? ????????? regsvr ?? regsvr32 ???????? ?? Visual C++. ?? ??? ???????? ?? ???? ????? ??? ????? ??????; ?????? ??? ??????? ???????? ??? ??????? ??????? ????????.

??????? ????

?????? ???? ?????? ??????? ????? ?????? ?? ??? ????? OLE ?????? ??? ??????? ???? ?????. ??? ??????? LoadLibrary() ?????? ???? ?????? ??? ??????? GetProcAddress() ???? ?????? ??? ????? ?????? DllRegisterServer() ? ?? ??????? DllRegisterServer() ????? ???? ??????.

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

  • ???? ?? ???? ???????? OLE DLLs ??? ????? ?? ??????. ???? ?????? ??? ??????? ??? ????? ????? ???? OLE ???????? ??? ??? ?? DLLs ???????? ??? ?? Shipctrl.wri ????? ??????? ?? ??? ???????? ??????.
  • ??? ????? ???? ?????? DLL ??? ????? OLE ? ??? DLL ??? ????? ?? ??????. ??? ????? ???? ?????? ?? ??????? ????? ??? ????? ?? DLLs ???? ?? ??????? ?????? ???? ???? ???????? ???????. ??? ???? ?? ?? ??? DLLs ?????? ?? ??? ?????? ???? ?????? ?? ??? ????? ?????? ??? ???? ?????.
  • ?? ???? DLL ???? ?? ???? ?? ????? ????. ??? ?? ????? ???? ?????? ???????? ????? ???? ?? DLL ?? ???? ?????? ??? ???? ?????????, ???? ?????? ?? ?? ??? ????? ???? ????? ??? ???? ?????.
  • ????? ???? ?? Ocd25.lib ??? ?????. ??? ??? ???? ?????? ?????? ???? MFC ????? ????????, ?? ???? ???? ????? ?? ????? ????? Ocd25.lib ?????? ??.
  • ??? ??? ???? ???? OLE ??? ???? ??????? ?????? ?????? Novell. ?? ??? ??????? ???? ?????? ??? ????? .ocx ?? ???? ???? ?????? ?? ???????. ???? ?? ????? ???? ?????? ??? ????? .ocx ??? ???? ??????? ??? "??" ???? ???????? ??? ??????? ???????? ?? ??????? ??????? ???????.

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

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

  1. ?? ??????? ???? ???? ????? ?? Visual C++ ????? ????? ???????? ???? ????? ????? ??? OLE ?????? ?????? ????? (Tstcon16.exe ?? Tstcon32.exe). ??? ??? ????? "????? ??????" (??? ???? ?????) ? ??? ???? ??? ????? ?? "????? ??????" ?? ????? ??? ??????? ???????. ????? ??? ?? ?? ?????????.
  2. ?? "????? ??????" ??? ?????? ????? ???? ??????. ?????? ??????? ??????? ?? "????? OLE ??????" ?? ??? DLL ???????. ??? ??? ???? ?????? ?????? 16-?? ???? ?????? DBWIN ?? ???????? ????? ????? ???????.

    ?????? ??? ??????? ??? ????? ????? ????? ?????? ??????? ?? DLL debug ???? ?????, ???? ?????? ????? ????????? "??????? DLLs" ?? ????????.
?????? ????? ????? ?????? ????? ???? ?????? ?????? ??????. ????? ????? ????? AppWizard MFC ????? ????? ????? ??? ???? ???? "?" ????? OLE. ???? ????? ????? OLE ??? ????? OLE ???? ???? ???????? ???????? ????? ???? ?????? ???? ????. ?? ??? ????? CWinApp ???? ??? ???? InitInstance() ?? ??? ?????? ??? ???:
BOOL CTestregApp::InitInstance()
{

   // Initialize OLE libraries
   if (!AfxOleInit())
   {
      AfxMessageBox(IDP_OLE_INIT_FAILED);
      return FALSE;
   }
				
??? ??? ?????? ?????? ???? ????????? ???????? ??????? ??? ???? ?? ??????? ?? ???? ??????? ?? LoadLibrary() ? GetProcAddress() DllRegisterServer.
#ifdef _WIN32
    HINSTANCE hDLL = LoadLibrary("some.ocx");
    if(NULL == hDLL)
    {
        // See Winerror.h for explaination of error code.
        DWORD error = GetLastError();
        TRACE1("LoadLibrary() Failed with: %i\n", error);
        return FALSE;
    }

    typedef HRESULT (CALLBACK *HCRET)(void);
    HCRET lpfnDllRegisterServer;

    lpfnDllRegisterServer =
            (HCRET)GetProcAddress(hDLL, "DllRegisterServer");
    if(NULL == lpfnDllRegisterServer)
    {
        // See Winerror.h for explaination of error code.
        DWORD error = GetLastError();
        TRACE1("GetProcAddress() Failed with %i\n", error);
        return FALSE;
    }

    if(FAILED((*lpfnDllRegisterServer)()))
    {
        TRACE("DLLRegisterServer() Failed");
        return FALSE;
    }

#else // 16-bit
    HINSTANCE hDLL = LoadLibrary("regtest.ocx");
    if(HINSTANCE_ERROR > hDLL)
    {
        // See LoadLibrary() help for explaination of error code.
        TRACE1("LoadLibrary() Failed with: %i\n", hDLL);
        return FALSE;
    }

    typedef HRESULT (CALLBACK *HCRET)(void);
    HCRET lpfnDllRegisterServer;

    lpfnDllRegisterServer =
            (HCRET)GetProcAddress(hDLL, "DllRegisterServer");
    if(NULL == lpfnDllRegisterServer)
    {
        // See GetProcAddress() help for explaination of error code.
        TRACE("GetProcAddress() Failed");
        return FALSE;
    }

    if(FAILED((*lpfnDllRegisterServer)()))
    {
        TRACE("DLLRegisterServer() Failed");
        return FALSE;
    }
#endif
				

???????

???? ???????: 140346 - ????? ??? ??????: 07/????/1424 - ??????: 2.0
????? ???
  • Microsoft Visual C++ 1.5 Professional Edition
  • Microsoft Visual C++ 1.51
  • Microsoft Visual C++ 1.52 Professional Edition
  • Microsoft Visual C++ 2.0 Professional Edition
  • Microsoft Visual C++ 2.1
  • Microsoft Visual C++ 2.2
  • Microsoft Visual C++ 4.0 Standard Edition
????? ??????: 
kbmt kbcode kbctrl KB140346 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????140346
????? ??????? ?? ????? ???? ?? ????? ???????
?? ????? ????? ?????? ???? ???? ???? ??? ??????? ??? ?? ? ?? ??? ??????? Microsoft ??? ????? ??? ??????? ????? ?????? ?????

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

 

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