alex feinman tapi wrapper - help!

D

droll

this bit of simple code i would assume would allow me to capture when a call
occurs and to hang up the call. but it crashes with a exception not
supported error :(

i also tried copying the supplied sample app (Tapi.exe) into the emulator.
it crashes as well upon execution :(

are there some pre-requisites that i'm missing? i'm developing this on a WM5
PPC device / emulator.

????

=================this is the code===========

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using OpenNETCF.Tapi;

namespace CallManager
{
public partial class Form1 : Form
{
Tapi tapiObj = new Tapi();
Line lineObj;
Call callObj;

public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
tapiObj.Initialize();
lineObj =
tapiObj.GetCellularLine(LINEMEDIAMODE.INTERACTIVEVOICE,
LINECALLPRIVILEGE.MONITOR);
lineObj.NewCall += new Line.NewCallHandler(lineObj_NewCall);
}

private void lineObj_NewCall(Call call)
{
MessageBox.Show("Hit me!!");
callObj = call;
callObj.Hangup();
}
}
}
------------------------------this is the crash dump--------------------

- $exception {System.NotSupportedException: NotSupportedException
at System.Runtime.InteropServices.Marshal.SizeOfInternal()
at System.Runtime.InteropServices.Marshal.SizeOf()
at System.Runtime.InteropServices.Marshal.SizeOf()
at OpenNETCF.Tapi.Call..ctor()
at OpenNETCF.Tapi.Tapi.OnNewCall()
at OpenNETCF.Tapi.Tapi.TapiThreadProc()
} System.Exception {System.NotSupportedException}
+ [System.NotSupportedException] {System.NotSupportedException:
NotSupportedException
at System.Runtime.InteropServices.Marshal.SizeOfInternal()
at System.Runtime.InteropServices.Marshal.SizeOf()
at System.Runtime.InteropServices.Marshal.SizeOf()
at OpenNETCF.Tapi.Call..ctor()
at OpenNETCF.Tapi.Tapi.OnNewCall()
at OpenNETCF.Tapi.Tapi.TapiThreadProc()
} System.NotSupportedException
_HResult 0x80131515 int
_innerException null System.Exception
_message "NotSupportedException" string
+ _methodDescs {Dimensions:[0x00000006]} System.IntPtr[]
HResult 0x80131515 int
InnerException null System.Exception
Message "NotSupportedException" string
StackTrace "at
System.Runtime.InteropServices.Marshal.SizeOfInternal()\r\nat
System.Runtime.InteropServices.Marshal.SizeOf()\r\nat
System.Runtime.InteropServices.Marshal.SizeOf()\r\nat
OpenNETCF.Tapi.Call..ctor()\r\nat OpenNETCF.Tapi.Tapi.OnNewCall()\r\nat
OpenNETCF.Tapi.Tapi.TapiThreadProc()\r\n" string
- this {OpenNETCF.Tapi.Tapi} OpenNETCF.Tapi.Tapi
+ Calls {System.Collections.Hashtable} System.Collections.Hashtable
dwAPIVersionHigh 0x00020000 int
dwAPIVersionLow 0x00010004 int
+ hEvent 0x00000000 System.IntPtr
+ hLineApp 0x004bcb30 System.IntPtr
LineMessage null OpenNETCF.Tapi.Tapi.MessageHandler
+ Lines {System.Collections.Hashtable} System.Collections.Hashtable
m_dwNumDev 0x00000008 int
+ m_hLineApp 0x004bcb30 System.IntPtr
NumDevices 0x00000008 int
+ PendingRequests {System.Collections.Hashtable}
System.Collections.Hashtable
Reinitialize null OpenNETCF.Tapi.Tapi.ReinitializeHandler
stop false bool
+ thTapi {System.Threading.Thread} System.Threading.Thread
- msg {LINE_APPNEWCALL} OpenNETCF.Tapi.LINEMESSAGE
+ dwCallbackInstance 0x00000000 System.IntPtr
dwMessageID LINE_APPNEWCALL OpenNETCF.Tapi.LINEMESSAGES
+ dwParam1 0x00000000 System.IntPtr
+ dwParam2 0x004bdf90 System.IntPtr
+ dwParam3 0x00000002 System.IntPtr
+ hDevice 0x004bd0d0 System.IntPtr
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top