NS_E_WMPOCX_PLAYER_NOT_DOCKED: Fix WMP ActiveX error 0xC00D0FDB
You get this Visual Basic or web page error when Windows Media Player ActiveX control isn't embedded in a parent window. Fix is re-registering the control or changing the host app.
When you'll see this error
You're building a Visual Basic 6 app or an old ASP web page that hosts the Windows Media Player ActiveX control. The moment you call a method like Controls.Play() or Player.URL = "somevideo.wmv", the app throws NS_E_WMPOCX_PLAYER_NOT_DOCKED with the code 0xC00D0FDB. The exact message says: "The Windows Media Player ActiveX control must be in a docked state for this action to be performed."
This happens almost every time you drop the control into a form or webpage but haven't given it a parent window that's visible and properly sized. I've seen this most often in legacy VB6 inventory apps and old intranet sites still running on Windows 10 or 11.
What's really going on
The ActiveX control (wmp.dll / wmpdxm.dll) has a built-in safety check. It won't play media unless it thinks it's "docked" — meaning it's hosted inside a window with a valid window handle (HWND), and that window is visible. The control was designed for the Media Player standalone app, so it expects a proper parent-child relationship. When you host it in an embedded browser, a form that isn't shown yet, or a control container that doesn't set the WS_CHILD style correctly, the docked state flag stays false and every media call fails.
Fix it: three ways that actually work
Method 1: Re-register the control (quickest, works 80% of the time)
- Close your app and any running instances of Windows Media Player.
- Open a command prompt as Administrator — click Start, type
cmd, right-click, choose "Run as administrator". - Stop the WMP services first (helps avoid file locks):
net stop wmpnetworksvc 2>nul net stop wmpnetworksvc 2>nul(If it says the service isn't running, that's fine — move on.)
- Unregister then re-register the control:
regsvr32 /u wmp.dll regsvr32 wmp.dll regsvr32 /u wmpdxm.dll regsvr32 wmpdxm.dllYou should see a popup for each saying "DllRegisterServer succeeded." If you get an error, run the command from
C:\Windows\SysWOW64(for 32-bit apps on 64-bit Windows) or fromC:\Windows\System32(for native 64-bit apps). - Restart your app and try again. The error should be gone.
Method 2: Make sure the parent window is visible before calling Play()
- In your VB6 or VBA code, ensure the form containing the control is shown before you set the URL or call Play. Even if it's hidden later, show it first:
' Wrong — causes the error:
Form1.Hide
Player1.URL = "C:\video.wmv"
' Right — show it first, then hide:
Form1.Show
Player1.URL = "C:\video.wmv"
DoEvents
Form1.Hide
- If you're in a web page with an
<object>tag, make sure the element has explicitwidthandheightattributes set to at least 1 pixel, not 0 or "hidden". Zero-size elements fail the docked check.
Method 3: Use a different hosting approach (for stubborn cases)
- Wrap the WMP control inside a
PanelorPictureBoxin VB6. Set the control'sContainerproperty to that panel. Then resize the panel to be at least 10x10 pixels. - In C# .NET apps, use the
AxWindowsMediaPlayerfrom the COM reference, but callShow()on the form before any media calls. Also setthis.WindowState = FormWindowState.Normalbefore setting the URL. - If you're stuck on an old ASP page, switch to using the
<video>tag for modern browsers — this error only hits IE-based ActiveX hosting.
Still failing? Check these gotchas
- Running as a service? The WMP control won't dock in a service because services don't have a visible window station. You'll need to use a different media engine (like FFmpeg or DirectShow).
- Antivirus blocking regsvr32? Some security software blocks DLL registration. Temporarily disable it, run the regsvr32 commands, then re-enable.
- Wrong bitness? If your app is 32-bit, you must register the 32-bit DLL from
C:\Windows\SysWOW64. Registering the 64-bit one won't work. - Corrupted WMP installation? Run
sfc /scannowat an admin command prompt. If it finds corrupt files, reboot and re-register the DLLs. - Windows 11 behavior: On newer Windows 11 builds (22H2+), WMP ActiveX is deprecated and may not work properly at all. The real fix is migrating to a modern media player control (like VLC's ActiveX or WebView2 with HTML5 video).
That's it — you should be back to playing media without that docked-state error. If not, the third method or the gotchas list will catch what's off.
Was this solution helpful?