共用方式為


撥打電話

下列程式代碼範例示範如何建立呼叫物件、探索與呼叫相關聯的數據流、選取並建立適當的終端機、選取終端機到數據流,以及完成連線。

使用此程式代碼範例之前,您必須在 初始化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