Class TWriteThread (unit VSSComm32)

Inherits from

TThread

Constructors



Functions

procedure PostHangupCall;


function WriteComm( pDataToWrite: LPCSTR; dwSizeofDataToWrite: DWORD ): Boolean;

TWriteThread.

procedure Execute;

*****************************************************************************) // WRITE THREAD (******************************************************************************) // // PROCEDURE: TWriteThread.

function HandleWriteData( lpOverlappedWrite: POverlapped; pDataToWrite: PChar; dwNumberOfBytesToWrite: DWORD): Boolean;

TWriteThread.

Properties

Events

Variables

hCloseEvent : THandle;


hCommFile : THandle;


hVSSComm32Window : THandle;



Constructors


Functions


procedure PostHangupCall;


function WriteComm( pDataToWrite: LPCSTR; dwSizeofDataToWrite: DWORD ): Boolean;

TWriteThread.HandleWriteData


procedure Execute;

*****************************************************************************) // WRITE THREAD (******************************************************************************) // // PROCEDURE: TWriteThread.Execute // // PURPOSE: The starting point for the Write thread. // // PARAMETERS: // lpvParam - unused. // // RETURN VALUE: // DWORD - unused. // // COMMENTS: // // The Write thread uses a PeekMessage loop to wait for a string to write, // and when it gets one, it writes it to the Comm port. If the CloseEvent // object is signaled, then it exits. The use of messages to tell the // Write thread what to write provides a natural desynchronization between // the UI and the Write thread. // //


function HandleWriteData( lpOverlappedWrite: POverlapped; pDataToWrite: PChar; dwNumberOfBytesToWrite: DWORD): Boolean;

TWriteThread.Execute} // // FUNCTION: HandleWriteData(LPOVERLAPPED, LPCSTR, DWORD) // // PURPOSE: Writes a given string to the comm file handle. // // PARAMETERS: // lpOverlappedWrite - Overlapped structure to use in WriteFile // pDataToWrite - String to write. // dwNumberOfBytesToWrite - Length of String to write. // // RETURN VALUE: // TRUE if all bytes were written. False if there was a failure to // write the whole string. // // COMMENTS: // // This function is a helper function for the Write Thread. It // is this call that actually writes a string to the comm file. // Note that this call blocks and waits for the Write to complete // or for the CloseEvent object to signal that the thread should end. // Another possible reason for returning FALSE is if the comm port // is closed by the service provider. // //


Properties


Events


Variables


hCloseEvent : THandle;


hCommFile : THandle;


hVSSComm32Window : THandle;