Hi,

I need to play MP3 files from my .NET 2.0 SP1 C# WinForm app.

I tried referencing Microsoft.DirectX.AudioVideoPlayback; and creating Audio
class for playback. But I get the following error which is beyod my ability
to comprehend.

[
DLL
'C:\WINDOWS\assembly\GAC\Microsoft.DirectX\1.0.2902.0__31bf3856ad364e35\Microsoft.DirectX.dll'
is attempting managed execution inside OS Loader lock. Do not attempt to run
managed code inside a DllMain or image initialization function since doing
so can cause the application to hang.
]

How do I do this. Please help.

- Andrew

RE: how to play MP3 files by Reuben

Reuben
Sat Mar 08 21:20:00 CST 2008

Try using creating an instance of the Windows Media Player ActiveX object. If
you Google for something along those lines, you should find plenty of
examples.
If you have troubles with the implementation, I recommend you start by
embedding it in a form, then create and use it exclusively in code.

Re: how to play MP3 files by Andrew

Andrew
Sun Mar 09 00:19:24 CST 2008

Thanks Reuben for the hint...

Based on this, I searched for Windows Media Player and found the following:

http://msdn2.microsoft.com/en-us/library/bb248590(VS.85).aspx

I am working on it... lets see if i get a success...

Thanks :)


"Reuben" <Reuben@discussions.microsoft.com> wrote in message
news:5BFA45A4-9073-4EC9-B395-343F2D717C9D@microsoft.com...
> Try using creating an instance of the Windows Media Player ActiveX object.
> If
> you Google for something along those lines, you should find plenty of
> examples.
> If you have troubles with the implementation, I recommend you start by
> embedding it in a form, then create and use it exclusively in code.