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_cas t<Audio*(lParam );
CComSafeArray<S HORT, VT_I2safeArray;
if(aud->samples)
safeArray.Add(a ud->samples, aud->rawAudio, TRUE);
CComVariant vtVar(safeArray );
m_pListener->Fire_OnUserAud ioData(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.w ant.s...@mvps.o rg>
wrote:
How do I convert this "ref
object" to a short array?
You probably only need a cast.
void YourEventHandle r(ref object o)
{
short[] arr = (short[])o;
// Do stuff...
}
If that doesn't work please tell us what o.GetType().Ful lName returns.
Mattias
--
Mattias Sjögren [C# MVP] mattias @ mvps.orghttp://www.msjogren.ne t/dotnet/|http://www.dotnetinterop.com
Please reply only to the newsgroup.