Handmade Hero»Forums»Code
5 posts
[SOLVED] Can't wrap my head around one specific thing in direct sound episode. Need directions and help.
Edited by kepler425b on
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.
Mārtiņš Možeiko
2562 posts / 2 projects
[SOLVED] Can't wrap my head around one specific thing in direct sound episode. Need directions and help.
Edited by Mārtiņš Možeiko on
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.
5 posts
[SOLVED] Can't wrap my head around one specific thing in direct sound episode. Need directions and help.
Thank you, solved it.