Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » UltraLite - C and C++ Programming » Application development » UltraLite application development for Windows Mobile » Windows Mobile synchronization


Adding ActiveSync synchronization in the main dialog class

Catch synchronization messages in your main dialog class.


You must use Microsoft Foundation Classes to develop your application


Your application must create and register a custom window class name for notification.

  1. Add a registered message and declare a message handler.

    Find the message map in the source file for your main dialog (the name is of the same form as CMyAppDlg.cpp). Add a registered message using the static and declare a message handler using ON_REGISTERED_MESSAGE as in the following example:

     ::RegisterWindowMessage( UL_AS_SYNCHRONIZE );
      OnDoUltraLiteSync )
  2. Implement the message handler.

    Add a method to the main dialog class with the following signature. This method is automatically executed any time the MobiLink provider for ActiveSync requests that your application synchronize. The method should call the ULSynchronize method.

    LRESULT CMyAppDlg::OnDoUltraLiteSync(
       WPARAM wParam,
       LPARAM lParam

    The return value of this function should be 0.


The main dialog class performs a synchronization.

 See also