Всем Привет!
Windows 8.1 / C++
Есть задачка... позвонить на Polycom телефон используя ІР телефонию через протокол Н323.
MicroSoft для таких случаев рекомендует использовать TAPI.
В MSDN нашел несколько примеров, и попробовал реализовать...
// Initialize COM.
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
// If (hr != S_OK) process the error here.
// Create a TAPI entry point object.
ITTAPI *gpTapi; // globally allocated
hr = CoCreateInstance(
CLSID_TAPI,
NULL,
CLSCTX_INPROC_SERVER,
IID_ITTAPI,
(LPVOID *)&gpTapi
);
// If (hr != S_OK) process the error here.
// Initialize TAPI.
hr = gpTapi->Initialize();
// If (hr != S_OK) process the error here.
/////////////////////////////////////////////
VARIANT_BOOL bSupport;
// Declare the interfaces used to select an address.
IEnumAddress * pIEnumAddress;
ITAddress * pAddress = NULL;
ITMediaSupport * pMediaSupport;
// Use the TAPI object to enumerate available addresses.
hr = gpTapi->EnumerateAddresses( &pIEnumAddress );
// If (hr != S_OK) process the error here.
// Locate an address that can support the media type the application needs.
while ( S_OK == pIEnumAddress->Next(1, &pAddress, NULL) )
{
// Determine the media support.
hr = pAddress->QueryInterface(
IID_ITMediaSupport,
(void **)&pMediaSupport
);
// If (hr != S_OK) process the error here.
// In this example, the required media type is already known.
// The application can also use the address object to
// enumerate the media supported, then choose from there.
hr = pMediaSupport->QueryMediaType(
TAPIMEDIATYPE_AUDIO|TAPIMEDIATYPE_VIDEO,
&bSupport
);
// If (hr != S_OK) process the error here.
if (bSupport)
{
break;
}
}
// pAddress is now a usable address.
У меня pAddress просто NULL.
Все hr возвращают S_OK.
Подскажите плиз, как быть?
Может я не инициализоровал чего?
Или не настроил?