Understanding UltraLite.NET Development
Synchronizing UltraLite applications
This section describes how to add ActiveSync synchronization to an UltraLite.NET application, and how to register your application for use with ActiveSync on your end users' computers.
For general information about setting up ActiveSync synchronization, see Deploying applications that use ActiveSync. For general information about adding synchronization to an application, see UltraLite Clients.
ActiveSync synchronization can only be initiated by ActiveSync. ActiveSync initiates synchronization when the device is placed in the cradle or when the Synchronization command is selected from the ActiveSync window.
When ActiveSync initiates synchronization, the MobiLink ActiveSync provider starts the UltraLite application, if it is not already running, and sends a message to it. Your application must implement a ULActiveSyncListener to receive and process messages from the MobiLink provider. Your application must specify the listener object using the SetActiveSyncListener method, where MyAppClassName is a unique Windows class name for the application.
dbMgr.SetActiveSyncListener( "MyAppClassName", listener );
For more information, including sample code, see the ULActiveSyncListener interface (iAnywhere.Data.UltraLite namespace) or ActiveSyncListener interface (iAnywhere.UltraLite namespace).
When UltraLite receives an ActiveSync message, it invokes the specified listener's ActiveSyncInvoked() method on a different thread. To avoid multi-threading issues, your ActiveSyncInvoked() method should post an event to the user interface.
If your application is multi-threaded, use a separate connection and use the lock keyword in C# or SyncLock keyword in Visual Basic .NET to access any objects shared with the rest of the application. The ActiveSyncInvoked() method should specify a ULStreamType.ACTIVE_SYNC for its connection's SyncParms.Stream and then call ULConnection.Synchronize().
When registering your application, set the following parameter.
Class Name The same class name the application used with the Connection.SetActiveSyncListener method.
SQL Anywhere Studio 9.0.2
Copyright © 1989–2004 Sybase, Inc. Portions copyright © 2001–2004 iAnywhere Solutions, Inc. All rights reserved.