PlaySound vs PlaySoundW

I recently updated one of our projects to 4.20 and began having a linker error from using ‘WidgetRenderer’. After looking around I found someone suggesting also including ‘#include “Runtime/UMG/Public/UMG.h”’ and I think that sorted this issue.

However, that opened up another issue:

Error C2039 ‘PlaySoundW’: is not a member of ‘FSlateApplication’ MyProject MyEngineDir\engine\source\runtime\slate\public\Widgets\Input\SComboBox.h 484

I have tracked this down to my project using Photon and possibly some AllowWindowsType stuff, amoung other things. Was wondering if anyone has had similar issues with plugins causing these issues or if there is a way around them. It seems to be confusing the PlaySound from FSlateApplication with the default windows PlaySoundW.

Seems that one of my Plugins (Photon defines.h) was using "include ". I removed it as Photon didn’t seem to use it and it stopped complaining.
Looks like some dependancy stuff with how modules are loaded possible.

I realize this is a bit late to reply, I had this problem when using ComboBoxes as well and the way I solved it was to add the function to SlateApplication.h and define it in the SlapeApplication.cpp.
I gave it the same exact parameters and statement as PlaySound.

This is probably not the optimal way to solve the issue but it worked for me and was pretty easy to implement.

Hey, appreciate the answer. I’ve had other issues with GetObject and GetObjectW and have decided to at the top of the files that are giving the errors, using:
#ifdef PlaySound
#undef PlaySound

Seems to work but also isn’t ideal.