The following example doesn't work, obviously. My question is how to make it work.
array<String^>^ MyRefClass::GetAvailableInputs()
{
List<String^>^ result = gcnew List<String^>();
DirectSoundCaptureEnumerate(&DSEnumCallback, &result);
return result->ToArray();
}
BOOL CALLBACK DSEnumCallback(LPGUID lpGuid, LPCWSTR lpcstrDescription,
LPCWSTR lpcstrModule, LPVOID lpContext)
{
((List<String^>^)lpContext)->Add(gcnew String(lpcstrDescription));
return TRUE;
}