I was able to resolve my original problem and I am getting the pointer back. It appears that I just had to send and IntPtr as a ref parameter and use that.
That leaves me with one other problem that I haven't yet found a clear answer to. Now that I have my pointer value, how do I use it to get to the actual interface? i have defined the C# interface to be able to access COM:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
namespace CoreAudioApi.Interfaces
{
[Guid("7FB7B48F-531D-44A2-BCB3-5AD5A134B3DC"),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAudioVolumeLevel : IPerChannelDbLevel { }
}
This coorsponds to the COM interface and is how my other interfaces are set up. The C++ example I am working from sends a pointer defined from the interface:
IAudioVolumeLevel* pIaudioVolumeLevel;
getMicrophoneBoostVolumeLevel(defaultDevice, &pIaudioVolumeLevel);
On returning the volume setting for this particular part can be examined and set:
pIaudioVolumeLevel->GetLevelRange(0, &fMinDb, &fMaxDb, &fStepDb);
pIaudioVolumeLevel->GetLevel(0, &pfCurrentDb);
pIaudioVolumeLevel->SetLevel(0, pfCurrentDb, NULL);
Assuming i am getting the correct value in the returned pointer, how do I now set the level through C#?
Thank you