주소 선택
다음 코드 예제에서는 TAPI 개체를 사용하여 지정된 미디어 형식 요구 사항 집합을 처리할 수 있는 주소에 대해 사용 가능한 전화 통신 리소스를 검사하는 방법을 보여 줍니다. 이 예제에서 오디오 및 비디오는 필수 미디어입니다.
이 코드 예제를 사용하기 전에 TAPI 초기화에서 작업을 수행해야 합니다.
참고
이 예제에는 오류 검사 및 프로덕션 코드에 적합한 릴리스가 없습니다.
// Declare the interfaces used to select an address.
IEnumAddress * pIEnumAddress;
ITAddress * pAddress;
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.
관련 항목
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기