Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

C# wmp.dll -> WMPPlayState.wmppsPlaying

EkBass

Bronze Coder
Hi.

Code below worked just fine like a few hours ago (song changed after previous one had stopped), but now it allways returns true. Im working with VS 2019 and it has now started to return warning
Severity Code Description Project File Line Suppression State
Warning MSB3305 Processing COM reference "WMPLib" from path "C:\WINDOWS\system32\wmp.dll". At least one of the arguments for 'IWMPGraphEventHandler.NotifyAcquireCredentials' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate. 2D Sidescroller C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 2827
C#:
if (wmp.playState != WMPPlayState.wmppsPlaying)

I have worked with keyboard inputs and not even opened class where this condition exists...i think.
 
hmm...after several wasted times after, i noticed this bugs out only with midi files. Changed files to wav or mp3 and all works out.
I think if i want to use midi music, a proper class for the job would be better.
 
Back
Top Bottom