전화 걸기

다음 코드 예제에서는 호출 개체를 만들고, 호출과 연결된 스트림을 검색하고, 적절한 터미널을 선택 및 만들고, 스트림에 터미널을 선택하고, 연결을 완료하는 방법을 보여 줍니다.

이 코드 예제를 사용하기 전에 TAPI 초기화주소 선택에서 작업을 수행해야 합니다.

또한 ITAddress::CreateCall 호출 후 터미널 선택에 설명된 작업을 수행해야 합니다.

참고

이 예제에는 오류 검사 및 프로덕션 코드에 적합한 릴리스가 없습니다.

 

// Specify the destination address.
//
// szAddressToCall and 
// dwAddressType have been
// retrieved from a user interface.
ITBasicCallControl * pBasicCall
bstrAddressToCall = SysAllocString( szAddressToCall );
// If ( bstrAddressToCall == NULL ) process the error here. 

HRESULT hr = pAddress->CreateCall(
    bstrAddressToCall,
    dwAddressType,
    &pBasicCall
 );
// If ( hr != S_OK ) process the error here. 

SysFreeString(bstrAddressToCall);

// Create the required terminals for this call.
{
    // See the Select a Terminal code example.
}

// Make the connection.
pBasicCall->Connect( TRUE );

ITAddress::CreateCall

ITBasicCallControl

ITBasicCallControl::Connect