Hi
When I get the full path of the VARIANT* type it says
"System.Boolean".
Here's how my IDL event is declared:
HRESULT OnUserAudioData([in] LONG nUserID, [in] LONG nSampleRate, [in]
VARIANT* pRawAudio, [in] LONG nSamples);
Here's how I pass my data to the event:
//-- begin
Audio* aud = reinterpret_cast<Audio*(lParam);
CComSafeArray<SHORT, VT_I2safeArray;
if(aud->samples)
safeArray.Add(aud->samples, aud->rawAudio, TRUE);
CComVariant vtVar(safeArray);
m_pListener->Fire_OnUserAudioData(aud->userid, aud->samplerate,
&vtVar, aud->samples);
//-- end
Any idea why C# thinks it's a boolean?
-- Bjoern
On Sep 25, 5:53 am, Mattias Sjögren <mattias.dont.want.s...@mvps.org>
wrote:
How do I convert this "ref
object" to a short array?
You probably only need a cast.
void YourEventHandler(ref object o)
{
short[] arr = (short[])o;
// Do stuff...
}
If that doesn't work please tell us what o.GetType().FullName returns.
Mattias
--
Mattias Sjögren [C# MVP] mattias @ mvps.orghttp://www.msjogren.net/dotnet/|http://www.dotnetinterop.com
Please reply only to the newsgroup.