Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/250351

From BetaArchive Wiki
Knowledge Base


Windows Media Format SDK Tool to Verify Presence of DCOM

Article ID: 250351

Article Last Modified on 11/7/2002



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.


Additional query words: netshow

Keywords: kbinfo KB250351