AddTapi.NET Developer's Manual
Initialize Method (applicationName)
NamespacesTraysoft.AddTapiTapiAppInitialize(String)
Initializes AddTapi.NET.
Declaration Syntax
C#Visual BasicVisual C++
public static void Initialize(
	string applicationName
)
Public Shared Sub Initialize ( _
	applicationName As String _
)
public:
static void Initialize(
	String^ applicationName
)
Parameters
applicationName (String)
A string that contains the name of the application.
Remarks
This method initializes AddTapi.NET and registers application name with Windows Telephony service. Initialize also populates Lines and Voices collections. Application must call this method before using any other AddTapi.NET functionality.
Note:
This method is not thread safe and should be called on the main thread of your application (UI thread for Windows Forms applications). AddTapi.NET captures synchronization context of the thread that calls Initialize and uses captured context to call event handlers on the same thread.
Examples
The following code shows how to initialize AddTapi.NET.

C#

            try
            {
                // Initialize AddTapi.NET
                TapiApp.Initialize("SampleApplication");
            }
            catch (TapiException exc)
            {
                Console.WriteLine("TAPI error during initialization. {0}", exc.Message);
            }
            catch (Exception exc)
            {
                Console.WriteLine("Exception during initialization. {0}", exc.Message);
            }
            

VB.NET

            Try
                ' Initialize AddTapi.NET
                TapiApp.Initialize("SampleApplication")
            Catch exc As TapiException
                Console.WriteLine("TAPI error during initialization. {0}", exc.Message)
            Catch exc As Exception
                Console.WriteLine("Exception during initialization. {0}", exc.Message)
            End Try
            
Exceptions
ExceptionCondition
TapiExceptionThe initialization failed because of Telephony API (TAPI) error.

Assembly: Traysoft.AddTapi (Module: Traysoft.AddTapi)