Jay,
ITLegacyCallMediaControl2 is an extension of the ITLegacyCallMediaControl
which is one of the interfaces of the TAPI3 call object created when an
address connects to another one. GetIDAsVariant() is a method of the
ITLegacyCallMediaControl2 interface (in C++, it is
ITLegacyCallMediaControl::GetID()).
I don't understand either why the return of
ITLegacyCallMediaControl2::GetIDAsVariant() is so opaque. It seems like it's
a low level function.
Here are some pieces of the related code :
Dim tapi As ITTAPI
Dim adresse As ITAddress
Dim appel As ITBasicCallControl
Dim telephoneNumber as String
'Create the tapi object.
tapi = New TAPI
'Call Initialize before calling any other TAPI function.
Call tapi.Initialize()
...
'adresse is one of the tapi.Addresses
...
'create a data call to a phone number
appel = adresse.CreateCall(telephoneNumber,
TapiConstants.LINEADDRESSTYPE_PHONENUMBER,
TapiConstants.TAPIMEDIATYPE_DATAMODEM)
appel.Connect(False)
...
'gets the TAPI3 comm port name
Dim portName As Byte() =
appel.GetIDAsVariant("comm/datamodem/portname")
'portName has to be converted to a String, each byte becoming a Char
of the String
'gets the TAPI3 comm port handle
Dim obj As Object = appel.GetIDAsVariant("comm/datamodem")
Dim hPort As IntPtr = Marshal.ReadIntPtr(obj, 0)
'now, you can use this handle in Win32 WriteFile(), ReadFile() calls
...