I work with the audio interfaces of Windows 7 and I hit a wall.
Basically, I need to take IAudioSessionControl2 * and get ISimpleAudioVolume * from it.
Now it looks like I can call IAudioSessionManager-> GetSimpleAudioVolume () using the value IAudioSessionControl2-> GetSessionInstanceIdentifier (...) . Please note that this is not explicitly stated as such in the docs, but this seems to be reasonable behavior.
The problem is, GetSimpleAudioVolume () accepts the GUID * and GetSessionInstanceIdentifier () spits out LPWSTR. Through debugging, I confirmed that the return'd value from GetSessionInstanceIdentifier () at least looks like a GUID.
So, the actual question is how to convert LPWSTR to GUID? I understand that this is pretty trivial if I go over to some managed code and use the built-in GUID , but there should be a C ++ way of doing this.
Well, these APIs definitely don't work the way I say what they do in the above text dump. However, the main question String → GUID answers, so I'm not going to delete the question.
source
share