小弟寫個TAPI打電話FUNCTION,電話可以打出去~~但是沒有辦法得到CALLBACK的訊息
小弟貼個源碼請高手幫忙一下!!看哪裡有問題!!感激不盡!!
只要知道如何讓源碼有辦法得到CALLBACK的訊息立刻結帖
makecall()
{
LINEINITIALIZEEXPARAMS liep =
{
sizeof (LINEINITIALIZEEXPARAMS), //dwTotalSize
0, //dwNeededSize
0, //dwUsedSize
LINEINITIALIZEEXOPTION_USEEVENT, //dwOptions:
LINEINITIALIZEEXOPTION_USEHIDDENWINDOW
0, //Handles
0 //dwCompletionKey
};
lineInitializeEx(&g_hLineApp, g_hInst, (LINECALLBACK) MylineCallbackFunc, g_szAppName, &g_dwNumDevs,
&g_dwAPIVersion, &liep);
for (dwLineID = 0; dwLineID < g_dwNumDevs; ++dwLineID)
{
LPWST lpszTSPName = L"Cellular TAPI Service Provider";
lineNegotiateAPIVersion (
g_hLineApp, // TAPI registration handle
dwLineID, // Line device to be queried
EARLY_TAPI_VERSION, // Least recent API version
TAPI_CURRENT_VERSION, // Most recent API version
&(lpLineInfo->dwAPIVersion), // Negotiated API version
NULL)) // Must be NUL
lineGetDevCaps(g_hLineApp, dwCurrentDeviceID, g_dwAPIVersion, g_dwExtVersion, lpLineDevCaps);
lpszProviderInfo = (LPWSTR)((DWORD)lpLineDevCaps + lpLineDevCaps->dwProviderInfoOffset);
lpszDevName = (LPTSTR)((LPBYTE)lpLineDevCaps + lpLineDevCaps->dwLineNameOffset);
if (0 == (wcscmp(lpszLineName, lpszTSPName)))
{
LPLINECALLPARAMS lpCallParams;
lineOpen(g_hLineApp, g_dwTSPILineDeviceID, &g_hLine, g_dwAPIVersion, g_dwExtVersion, g_dwCallbackInstance,
LINECALLPRIVILEGE_MONITOR | LINECALLPRIVILEGE_OWNER, LINEMEDIAMODE_DATAMODEM , NULL);
if (!(lpCallParams = (LPLINECALLPARAMS) LocalAlloc (LPTR, dwSizeOfCallParams)))
{
MessageBox(TEXT("%s: MakeCall_Paramsfail faild %x\n"), g_szAppName, MB_OK);
}
ZeroMemory(lpCallParams, dwSizeOfCallParams);
lpCallParams->dwTotalSize = dwSizeOfCallParams;
lpCallParams->dwBearerMode = LINEBEARERMODE_VOICE;
lpCallParams->dwMediaMode = LINEMEDIAMODE_DATAMODEM;
lpCallParams->dwCallParamFlags = LINECALLPARAMFLAGS_IDLE;
lpCallParams->dwAddressMode = LINEADDRESSMODE_ADDRESSID;
lpCallParams->->dwAddressID = g_dwCurrentLineAddr;
lpCallParams->dwDisplayableAddressSize = lpTransOutput->dwDisplayableStringSize;
lpCallParams->dwDisplayableAddressOffset = sizeof (LINECALLPARAMS);
lineMakeCall(g_hLine, &g_hCall, TEXT("0955110211"), 0, lpCallParams);
}//end if (0 == (wcscmp(lpszLineName, lpszTSPName)))
}//end for (dwLineID = 0; dwLineID < g_dwNumDevs; ++dwLineID)
}//end makecall