Class TTapiTerminal (unit TapiTerm) |
TComponent
Constructors |
--------------------------------------------------------------------------------------------- ********************************************************************************************** TERMINAL PART ********************************************************************************************** ---------------------------------------------------------------------------------------------} (******************************************************************************) // TTapiTerminal PUBLIC METHODS (
Functions |
TTapiTerminal.
Properties |
Events |
Variables |
Constructors |
Public declarations
--------------------------------------------------------------------------------------------- ********************************************************************************************** TERMINAL PART ********************************************************************************************** ---------------------------------------------------------------------------------------------} (******************************************************************************) // TTapiTerminal PUBLIC METHODS (
Functions |
Check for version (copied from a TAPI sample)
We have a direct connection;
---- Free the memory help by lpVarString
case
TTapiTerminal.StopComm} // // FUNCTION: WriteCommData(PChar, Word) // // PURPOSE: Send a String to the Write Thread to be written to the Comm. // // PARAMETERS: // pszStringToWrite - String to Write to Comm port. // nSizeofStringToWrite - length of pszStringToWrite. // // RETURN VALUE: // Returns TRUE if the PostMessage is successful. // Returns FALSE if PostMessage fails or Write thread doesn't exist. // // COMMENTS: // // This is a wrapper function so that other modules don't care that // Comm writing is done via PostMessage to a Write thread. Note that // using PostMessage speeds up response to the UI (very little delay to // 'write' a string) and provides a natural buffer if the comm is slow // (ie: the messages just pile up in the message queue). // // Note that it is assumed that pszStringToWrite is allocated with // LocalAlloc, and that if WriteCommData succeeds, its the job of the // Write thread to LocalFree it. If WriteCommData fails, then its // the job of the calling function to free the string. // //
Protected declarations
TTapiTerminal.WriteCommData} (******************************************************************************) // TTapiTerminal PROTECTED METHODS (******************************************************************************) // // FUNCTION: CloseReadThread // // PURPOSE: Close the Read Thread. // // PARAMETERS: // none // // RETURN VALUE: // none // // COMMENTS: // // Closes the Read thread by signaling the CloseEvent. // Purges any outstanding reads on the comm port. // // Note that terminating a thread leaks memory. // Besides the normal leak incurred, there is an event object // that doesn't get closed. This isn't worth worrying about // since it shouldn't happen anyway. // //
TTapiTerminal.CloseReadThread} // // FUNCTION: CloseWriteThread // // PURPOSE: Closes the Write Thread. // // PARAMETERS: // none // // RETURN VALUE: // none // // COMMENTS: // // Closes the write thread by signaling the CloseEvent. // Purges any outstanding writes on the comm port. // // Note that terminating a thread leaks memory. // Besides the normal leak incurred, there is an event object // that doesn't get closed. This isn't worth worrying about // since it shouldn't happen anyway. // //
TTapiTerminal.CloseWriteThread
< 0 then MessageDlg('Error: Could not drop the call.', mtError, [mbok], 0);
FILE_ATTRIBUTE_NORMAL+
*****************************************************************************) // TTapiTerminal PRIVATE METHODS (
FUNCTION: StartComm // PURPOSE: Starts communications over the comm port. // PARAMETERS: hNewCommFile - This is the COMM File handle to communicate with. This handle is obtained from TAPI. // RETURN VALUE: TRUE if able to setup the communications. // COMMENTS: // StartComm makes sure there isn't communication in progress already, creates a Comm file, and creates the read and write threads. It also configures the hNewCommFile for the appropriate COMM settings. // If StartComm fails for any reason, it's up to the calling application to close the Comm file handle. // //
TTapiTerminal.StartComm} // // FUNCTION: StopComm // // PURPOSE: Stop and end all communication threads. // // PARAMETERS: // none // // RETURN VALUE: // none // // COMMENTS: // // Tries to gracefully signal all communication threads to // close, but terminates them if it has to. // //
Properties |
Published declarations
Events |
Variables |
Private declarations