1

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

Valentin Radu
  • 629
  • 1
  • 11
  • 26

1 Answers1

1

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.

Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
  • Yes, I think you're right: the media features are not essentials in my app but it is still good for the user to have them. As far as I know, the Windows N editions aren't so used as expected and are available only in the EU, Switzerland and Croatia. I tried a different approach before using Windows Media Player: NAudio, but it still uses the system's media functions so it's also useless. Now, I guess I can provide 2 versions of my app or prompt the user to install the Media Player when installing the app. Anyway, thanks for your info, I'll think about it! Thanks! – Valentin Radu Aug 07 '12 at 20:06
  • @Valentin: You're welcome! You could do something like disable the specific features that use the media library if the libraries aren't installed. That way, users could use most of the app all the time, and then install Windows Media if they want the added functionality. I don't know if that would be relevant to your application, but it would be something to consider. – Jon Seigel Aug 07 '12 at 20:42