Starting Local COM Server Returns Error Code 0x80080005 (254659)



The information in this article applies to:

  • Microsoft Windows 98 Second Edition
  • Microsoft Distributed Component Object Model (DCOM) 1.2
  • Microsoft Windows 95
  • Microsoft Windows 98

This article was previously published under Q254659

SYMPTOMS

When you start your computer without a network and then dynamically add a network (by inserting a PCMCIA network adapter or by using Dial-Up Networking), the first attempt to start a local COM server is unsuccessful if Distributed Component Object Model (DCOM) is installed.

The underlying error message is detailed in the following table.

TypeValue
Standard Error TextServer Execution Failed
Error Code (hexadecimal)0x80080005
Error Code (decimal)-2146959355
Error code (symbolic)CO_E_SERVER_EXEC_FAILURE

CAUSE

When there is no network, DCOM identifies the local computer using RPCSS with the loopback address (127.0.0.1). When you dynamically add a network, remote procedure call (RPC) does not detect the new Internet Protocol (IP) address until it is reinitialized. However, COM initializes first and sends a request to RPC to locate the local server. This does not trigger an RPC reinitialization, and subsequent attempts to start the local server can succeed.

WORKAROUND

To work around this behavior, start the client program a second time.

The following code sample shows how to bypass the problem programmatically:
#include "stdafx.h"

int fIsWin9X(void)
{
    OSVERSIONINFO info;
 
    ZeroMemory(&info, sizeof(OSVERSIONINFO));
    info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
    GetVersionEx( &info );
    if ( 4 == info.dwMajorVersion && VER_PLATFORM_WIN32_WINDOWS == info.dwPlatformId )
        return TRUE;
    return FALSE;
}

HRESULT myCoCreateInstance(
   REFCLSID rclsid,
   LPUNKNOWN pUnkOuter,
   DWORD dwClsContext,
   REFIID riid,
   LPVOID * ppv
)
{
    HRESULT hr = CoCreateInstance( rclsid, pUnkOuter, dwClsContext, riid, ppv );
    if ( CO_E_SERVER_EXEC_FAILURE == hr && fIsWin9X() )
        return CoCreateInstance( rclsid, pUnkOuter, dwClsContext, riid, ppv );
    return hr;
}
				

STATUS

Microsoft has confirmed that this is a problem in Windows 95 and Windows 98 with DCOM 1.3 installed.

Modification Type:MinorLast Reviewed:12/17/2004
Keywords:kberrmsg kbprb KB254659