Hi,
This is my code:
private TAPI3Lib.TAPIClass m_tapi=null;
private TAPI3Lib.ITAddress m_address=null;
private TAPI3Lib.ITBasicCallControl m_call=null;
ITMediaPlayback pMediaPlayback;
//....
private bool SelectTerminal()
{
try
{
ITTerminal pFileTerm=null;
ITTerminalSupport pTermSup=null;
pTermSup=(ITTerminalSupport)m_address;
pFileTerm=pTermSup.CreateTerminal(TapiConstants.CL SID_String_FilePlaybackTerminal, TapiConstants.TAPIMEDIATYPE_AUDIO,TERMINAL_DIRECTI ON.TD_CAPTURE);
if(pFileTerm==null)
MessageBox.Show("terminal is null");
pMediaPlayback=null;
pMediaPlayback=(ITMediaPlayback)pFileTerm;
object[] s=null;
if(m_strFileName.Length<1)
s=new string[]{"c:\\2.wav"};
else
s=new string[]{m_strFileName};
pMediaPlayback.PlayList=s;
ITCallInfo ci=(ITCallInfo)m_call;
ITBasicCallControl2 cc2=(ITBasicCallControl2)ci;
cc2.SelectTerminalOnCall(pFileTerm);
m_control=(ITMediaControl)pFileTerm;
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
return true;
}
//....
private void OnConnect()
{
m_control.Start();
}
The code gives me an Exception on this line:
pMediaPlayback.PlayList = s;
the exception is: Value does not fall within the expected range
What's that?What should I do?
From
http://www.developmentnow.com/g/21_0...rk-interop.htm
Posted via DevelopmentNow.com Groups
http://www.developmentnow.com