Well, I think I have to disappoint you.
Basically nothing of what you have there is compatible with Windows Forms which is part of the .net framework.
stdafx.h - Nope
mmdeviceapi.h - Nope (?)
CoInitialize(NULL); which is COM - Nope
The mmdeviceapi.h might work, but it seems to be part of COM.
Maybe via mmsystem.h which is the classic Windows multimedia lib. But I never tried it within a .net (Windows Forms) environment.
But you will have to rewrite your code completely. Sorry.
Hello everybody.
This code run ok on Vc++ Console 2012 . I want to run on Winform.
Can you help me ? Because i only used to Vb.net
I will send 40usd for you.
Seriously? Only $40? My help is worth $41, at least ;)
Ok, kidding aside, if you want to spend money, donate it to cplusplus.com.
Back to topic: I'm afraid you can't use the MMDevice API with .net. At least not without some effort.
Windows Forms uses managed code and I can't find any wrapper or class or namespace which provides the MMDevice API functions.
Maybe one of the .net buffs knows how to use non-managed COM API's in a WinForms environment.
I am newbie with Vc++2012. I only used to Vb.net.
Can you help me step by step to run this code on Winform with Vc++2012.
Do you know about AudiovolumeCoreApi .