MFStartup Function
Initializes Microsoft Media Foundation.
Syntax
HRESULT MFStartup(
ULONG Version,
DWORD dwFlags = MFSTARTUP_FULL
);
Parameter
Version
Version number. Use the value MF_VERSION, defined in mfapi.h.dwFlags
This parameter is optional when using C++ but required in C. The value must be one of the following flags:Wert Bedeutung MFSTARTUP_NOSOCKET Do not initialize the sockets library.
MFSTARTUP_LITE Equivalent to MFSTARTUP_NOSOCKET.
MFSTARTUP_FULL Initialize the entire Media Foundation platform. This is the default value when dwFlags is not specified.
Rückgabewert
The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Rückgabecode | Beschreibung |
---|---|
S_OK | The method succeeded. |
MF_E_BAD_STARTUP_VERSION | The Version parameter requires a newer version of Media Foundation than the version that is running. |
MF_E_DISABLED_IN_SAFEMODE | The Media Foundation platform is disabled because the system was started in "Safe Mode" (fail-safe boot). |
Hinweise
An application must call this function before using Media Foundation. Before your application quits, call MFShutdown once for every previous call to MFStartup.
Do not call MFStartup or MFShutdown from work queue threads. For more information about work queues, see Work Queues.
This function is available on the following platforms if the Windows Media Format 11 SDK redistributable components are installed:
- Windows XP mit Service Pack 2 (SP2) und höher.
- Windows XP Media Center Edition 2005 with KB900325 (Windows XP Media Center Edition 2005) and KB925766 (Oktober 2006 Updaterollup für Windows XP Media Center Edition) installed.
Beispiele
hr = MFStartup(MF_VERSION);
Anforderungen
Mindestens unterstützter Client |
Windows Vista |
Mindestens unterstützter Server |
Windows Server 2008 |
Header |
Mfapi.h |
Bibliothek |
Mfplat.lib |
DLL |
Mfplat.dll |