lineOpen always returns LINEERR_INVALPRIVSELECT
- From: ".rhavin grobert" <clqrq@xxxxxxxx>
- Date: Mon, 12 Jan 2009 10:58:49 -0800 (PST)
Hello;-/
I'm completely new to TAPI and struggle a little bit whith the
initialisation.... I try to write a little wrapper that initializes a
TAPI-interface and simplifies calls. My problem is that the lineOpen()-
function in QTapi::QTDial() always returns LINEERR_INVALPRIVSELECT.
the previos function called is CQTapi::QTInit() seems to work w/o any
problems. When the porgramm reaches QTapi::QTDial(), the variables of
my object have the following value...
m_dwNumDevices = 0x00000006
m_hLineApp = 0x800003ff
m_dwAPIVersion = 0x00010004
m_dwDeviceID = 00000005
m_LineExtID = {0,0,0,0}
It would be very nice if someone could explain why my lineOpen doesnt
work....
TIA, ~.rhavin;)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// QTapi.h: interface for the CQTapi class.
#if !defined
(AFX_QTAPI_H__08FAA168_FE9D_4829_B647_DE120521594C__INCLUDED_)
#define AFX_QTAPI_H__08FAA168_FE9D_4829_B647_DE120521594C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Tapi.h"
//-----------------------------------------------------------------------------
class CQTapi
{
public:
CQTapi();
virtual ~CQTapi();
bool QTInit(LPCTSTR szApplication);
bool QTDial(LPCTSTR szNumber);
protected:
virtual void QTOnEvent(DWORD dwMessage, DWORD P1, DWORD P2, DWORD P3)
{};
private:
void static CALLBACK _lineCBF(DWORD hDevice, DWORD dwMsg, DWORD
dwCBInstance,
DWORD dwP1, DWORD dwP2, DWORD dwP3);
DWORD m_dwNumDevices;
HLINEAPP m_hLineApp;
static CQTapi* m_pMyTapi;
DWORD m_dwAPIVersion;
DWORD m_dwDeviceID;
LINEEXTENSIONID m_LineExtID;
};
#endif // !defined
(AFX_QTAPI_H__08FAA168_FE9D_4829_B647_DE120521594C__INCLUDED_)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// QTapi.cpp: implementation of the CQTapi class.
#include "StdAfx.h"
#include "QTapi.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
#define EARLY_TAPI_VERSION 0x00010003
CQTapi * CQTapi::m_pMyTapi;
//-----------------------------------------------------------------------------
CQTapi::CQTapi() {
m_dwNumDevices = 0;
m_hLineApp = 0;
m_pMyTapi = NULL;
m_dwAPIVersion = 0;
m_dwDeviceID = 0;
}
//-----------------------------------------------------------------------------
CQTapi::~CQTapi() {}
//-----------------------------------------------------------------------------
bool CQTapi::QTInit(LPCTSTR szApplication)
{
m_pMyTapi = this;
DWORD dwRet = ::lineInitialize(&m_hLineApp, AfxGetInstanceHandle(),
(LINECALLBACK)_lineCBF, _T(szApplication), &m_dwNumDevices);
if (dwRet != 0)
return false;
DWORD dwCnt = m_dwNumDevices;
while (dwCnt-->0)
{
dwRet = ::lineNegotiateAPIVersion(m_hLineApp, dwCnt,
EARLY_TAPI_VERSION, TAPI_CURRENT_VERSION,
&m_dwAPIVersion, &m_LineExtID);
if (dwRet != 0)
continue;
m_dwDeviceID = dwCnt;
break;
}
return true;
}
//-----------------------------------------------------------------------------
bool CQTapi::QTDial(LPCTSTR szNumber)
{
HLINE hLine;
DWORD dwRet = ::lineOpen(m_hLineApp, m_dwDeviceID, &hLine,
m_dwAPIVersion,
LINECALLPRIVILEGE_NONE, 0, 0, 0, 0);
// #### this always returns LINEERR_INVALPRIVSELECT ;-/
return true;
}
//-----------------------------------------------------------------------------
void CALLBACK CQTapi::_lineCBF(DWORD hDevice, DWORD dwMsg, DWORD
dwCBInstance,
DWORD dwP1, DWORD dwP2, DWORD dwP3)
{
ASSERT(m_pMyTapi != NULL);
m_pMyTapi->QTOnEvent(dwMsg, dwP1, dwP2, dwP3);
}
.
- Follow-Ups:
- Re: lineOpen always returns LINEERR_INVALPRIVSELECT
- From: .rhavin grobert
- Re: lineOpen always returns LINEERR_INVALPRIVSELECT
- Prev by Date: Re: Need IP address of the phone extensions in TAPI2
- Next by Date: Re: lineOpen always returns LINEERR_INVALPRIVSELECT
- Previous by thread: Need IP address of the phone extensions in TAPI2
- Next by thread: Re: lineOpen always returns LINEERR_INVALPRIVSELECT
- Index(es):
Relevant Pages
|