Windows Media Format SDK Tool to Verify Presence of DCOM

ID: Q250351


The information in this article applies to:
  • Microsoft Windows Media SDK version 4.0


SUMMARY

Because the Windows Media Device Manager redistributed version (WMDMredist) requires the Distributed Component Object Model (DCOM) to successfully register all of its components, and because WMDMredist does not verify if DCOM is installed, it may be useful for third-party application writers to include a DCOM sniffer to see whether WMDMredist should be installed, or whether users should be directed to a download site or a computer store.


MORE INFORMATION

The following is the current DCOM sniffer used in the Windows Media Format SDK version 4.1. It detects for the presence of DCOM, and also checks to see if DCOM is enabled:


///////////////////////////////////////////////////////// 
BOOL DCOMIsInstalled()
///////////////////////////////////////////////////////// 
// This function verifies that DCOM is enabled
///////////////////////////////////////////////////////// 
///////////////////////////////////////////////////////// 
{
    HKEY hKey = NULL;
    TCHAR szDesiredKey[MAX_PATH];
    long lResult = ERROR_SUCCESS;
    
    _tcscpy( szDesiredKey, _T("Software\\Microsoft\\OLE") );

    lResult = RegOpenKeyEx( HKEY_LOCAL_MACHINE, szDesiredKey, 
0, KEY_QUERY_VALUE, &hKey );

    if( ERROR_SUCCESS != lResult )
    {
        return( FALSE );
    }

    DWORD cbSize = sizeof( szDesiredKey );

    lResult = RegQueryValueEx( hKey, _T("EnableDCOM"), NULL, 
NULL, ( LPBYTE )szDesiredKey, &cbSize );
         
    RegCloseKey( hKey );

    if( ERROR_SUCCESS == lResult )
    {
        return( 0 == _tcsicmp( _T("y"), szDesiredKey ) );
    }

    return( FALSE );
} 


DCOM packages can be found on the "Downloads and CD-ROMs" page on the following Microsoft Web site:
http://www.microsoft.com/com/resources/downloads.asp
DCOM is present by default on Windows 98 , Windows 98 Second Edition, Windows NT 4.0 SP3, and Windows 2000.

Additional query words: netshow

Keywords : kbwms41
Version : :4.0
Platform :
Issue type : kbinfo


Last Reviewed: January 25, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.