Re[2]: TAPI и COM-порт
От: ScorpZ Украина  
Дата: 21.09.04 08:03
Оценка:
Здравствуйте, VladSharkov, Вы писали:

V>>Можно ли в принципе работать одновременно с TAPI и COM-портом через файл ? Если нет, то как сделать ?


VS>Привет, народ, Хоть вопрос и давнишний, но он так и остался без ответа, и я присоединяюсь к вопрошающему. Если кто-то работал одновременно и c Tapi и c CreateFile, то натолкните на мысль. Буду призателен (и не только я один) за все полезные высказывания по вопросу.



В общем в свое время я сталкивался с такой проблемой . И вот что у меня получилось.
HANDLE ком порта (который мы получаем из CreateFile) можно получить через ТАПИ lineGetID — НО !!! Этот хэндл будет рабочий только при условии что линия , с которой мы получаем этот хэндл , (тапи линия модема , полученая через LineOpen) будет находиться в состоянии CONNECTED !!! В других случая хэндл будет не рабочий

// Вот небольшая статейка из МСДН по этому поводу

The lineGetID function fills a VARSTRING structure, setting dwStringFormat to the STRINGFORMAT_BINARY value and appending these additional members:

HANDLE hComm; // Win32 file handle to data modem
CHAR szDeviceName[1]; // name of data modem

The hComm member is the handle of the open communications port. This member is NULL if the port is not yet open or if the dwSelect parameter of lineGetID is not the LINECALLSELECT_CALL value. If a call is active, the service provider typically opens the port itself to get direct control of the communications hardware, but is only required to return a valid handle if the line is connected. The service provider opens the port using the FILE_FLAG_OVERLAPPED value and then configures the port using the settings specified by the lineSetDevConfig function. You can set additional configuration options for the device by using Win32 functions with the returned handle
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.