Windows Media Format SDK Tool to Verify Presence of DCOM (250351)



The information in this article applies to:

  • Microsoft Windows Media Services 4.0

This article was previously published under Q250351

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: DCOM is present by default on Windows 98 , Windows 98 Second Edition, Windows NT 4.0 SP3, and Windows 2000.

Modification Type:MajorLast Reviewed:11/7/2002
Keywords:kbinfo KB250351 kbAudDeveloper