Question

I have a problem and I don't know how to work around it: I used the WMPLib in my C# application (located in C:\Windows\System32\WMP.dll). I referenced it and dded it in the header of the main form's code file:

using WMPLib;

But if I try to run my app on a Windows N edition (I think also the KN edition counts here), it stops working and Windows shows the following message: "App-name has stopped working. You can check for a solution...". So now, I'm trying to find a way to work around this, for example, by not importing that DLL at run time when user is running a Windows N edition. I'm afraid that I wouldn't have a way to redistribute my app to Windows N users.

Thanks for any advice, Vali

Was it helpful?

Solution

The N editions do not come with Windows Media Player installed by default, which explains why the DLL is missing. Windows Media Player can, however, be installed after the fact.

This leaves you with two choices:

  • Dyamically load the DLL at runtime
  • Check for, and require that Windows Media Player is installed as a prerequisite (i.e., during setup)

You may actually want to do both. If your application requires this assembly to get its job done, on app startup, you probably want to check if the DLL is available. If it isn't, displaying a meaningful error message would be preferable to an outright crash.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top