Handmade Hero » Forums » Code » [SOLVED] Can't wrap my head around one specific thing in direct sound episode. Need directions and help.
kepler425b
2 posts
#13103 [SOLVED] Can't wrap my head around one specific thing in direct sound episode. Need directions and help.
1 month ago Edited by on Sept. 18, 2017, 2:22 p.m.

Can't wrap my head around this one - the function pointers:

1
2
3
4
5
6
7
8
#include <windows.h>
#include <math.h>
#include <dsound.h>
#include <stdio.h>


#define DIRECT_SOUND_CREATE(name) HRESULT WINAPI name(LPCGUID pcGuidDevice, LPDIRECTSOUND *ppDS, *LPUNKNOWN pUnkOuter)
typedef DIRECT_SOUND_CREATE(direct_sound_create);


And for some odd reason, my Visual Studio underlines the DIRECT_SOUNDE_CREATE and raises an error:



I've been unsuccessfully trying to solve this particular problem for weeks, need help or directions.
mmozeiko
Mārtiņš Možeiko
1485 posts
1 project
#13104 Can't wrap my head around one specific thing in direct sound episode. Need directions and help.
1 month ago Edited by Mārtiņš Možeiko on Sept. 17, 2017, 10 p.m.

You have mistake in last argument declaration.

"*LPUNKNOWN pUnkOuter" should be "LPUNKNOWN pUnkOuter" instead.
I suggest copy&pasting arguments from MSDN instead of manually typing it to avoid mistakes.
kepler425b
2 posts
#13108 Can't wrap my head around one specific thing in direct sound episode. Need directions and help.
1 month ago

Thank you, solved it.