Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working with WMPLib.WindowsMediaPlayer #72

Open
UserY1 opened this issue Dec 26, 2023 · 2 comments
Open

Working with WMPLib.WindowsMediaPlayer #72

UserY1 opened this issue Dec 26, 2023 · 2 comments

Comments

@UserY1
Copy link

UserY1 commented Dec 26, 2023

Hello, is it possible to somehow work with WMPLib.WindowsMediaPlayer ?

https://learn.microsoft.com/en-us/windows/win32/wmp/creating-the-windows-media-player-control-programmatically?redirectedfrom=MSDN
("To create the Windows Media Player control programmatically, you must first add a reference to wmp.dll, which is found in the \Windows\system32 folder. Adding this reference creates WMPLib.dll in your project folder, and a reference to WMPLib appears in Solution Explorer.")

I get an error.

@kant2002
Copy link
Owner

For any COM component you want to use, you should write ComWrappers manually or you can try WinFormsComInterop.SourceGenerator nuget package which should help you with this. This is one example how I use it. https://github.com/kant2002/WinFormsComInterop/blob/main/WinFormsComInterop/IFileOpenDialogWrapper.cs

@UserY1
Copy link
Author

UserY1 commented Dec 27, 2023

I installed the WinFormsComInterop.SourceGenerator generator..
I'm looking at an example IFileOpenDialogWrapper.cs. It’s not entirely clear, is this code already generated by the generator?

In this instruction https://github.com/dotnet/runtimelab/blob/feature/DllImportGenerator/designs/Pipeline.md
methods are marked with [GeneratedDllImport('Lib')] attributes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants