Skip to content

Conversation

@nemrism
Copy link
Contributor

@nemrism nemrism commented Aug 24, 2018

Replace msdn link in how-to-use-platform-invoke-to-play-a-wave-file.md
Contributes to #2037

@nemrism nemrism requested a review from BillWagner as a code owner August 24, 2018 02:52
Copy link
Contributor

@rpetrusha rpetrusha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the link, @nemrism. I do have one request for a change that is unrelated to your PR. If you'd prefer, we can make the change.

@nemrism
Copy link
Contributor Author

nemrism commented Aug 24, 2018

@rpetrusha, do you mean that you'll handle this update in another PR?

@rpetrusha
Copy link
Contributor

Either in this PR or a new PR,, @nemrism.


## Example
This example code uses `DllImport` to import `winmm.dll`'s `PlaySound` method entry point as `Form1 PlaySound()`. The example has a simple Windows Form with a button. Clicking the button opens a standard windows <xref:System.Windows.Forms.OpenFileDialog> dialog box so that you can open a file to play. When a wave file is selected, it is played by using the `PlaySound()` method of the winmm.DLL assembly method. For more information about winmm.dll's `PlaySound` method, see [Using the PlaySound function with Waveform-Audio Files](https://msdn.microsoft.com/library/aa910379.aspx). Browse and select a file that has a .wav extension, and then click **Open** to play the wave file by using platform invoke. A text box shows the full path of the file selected.
This example code uses `DllImport` to import `winmm.dll`'s `PlaySound` method entry point as `Form1 PlaySound()`. The example has a simple Windows Form with a button. Clicking the button opens a standard windows <xref:System.Windows.Forms.OpenFileDialog> dialog box so that you can open a file to play. When a wave file is selected, it is played by using the `PlaySound()` method of the winmm.DLL assembly method. For more information about winmm.dll's `PlaySound` method, see [Using the PlaySound function with Waveform-Audio Files](https://docs.microsoft.com/windows/desktop/multimedia/using-playsound-to-play-waveform-audio-files). Browse and select a file that has a .wav extension, and then click **Open** to play the wave file by using platform invoke. A text box shows the full path of the file selected.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, @nemrism. My comment was evidently lost. This is unrelated to your PR, but it's a very noticeable error in the original text. winmm.dll is neither an assembly nor a method. Could you change "of the winmm.DLL assembly method" to read "in the winmm.dll assembly"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As winmm.dll isn't an assembly nor a method, should we rather change it to read "of the winmm.dll library"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either "in" of "of" is fine.

@rpetrusha
Copy link
Contributor

I apologize, @nemrism. I'd meant to merge this three days ago. I'll merge it now, and it should be live on docs.microsoft.com in the next day or two.

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

Successfully merging this pull request may close these issues.

2 participants