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 和 C++ 编程 » 应用程序开发 » Windows Mobile 的 UltraLite 应用程序开发 » Windows Mobile 同步

 

ActiveSync 同步设置 (Windows API)

如果直接针对 Windows API 进行编程,则必须在应用程序的 WindowProc 函数中处理来自 MobiLink 提供程序的消息,使用 ULIsSynchronizeMessage 函数确定应用程序是否已收到消息。

下面是如何处理该消息的一个示例:



LRESULT CALLBACK WindowProc( HWND hwnd,
         UINT uMsg,
         WPARAM wParam,
         LPARAM lParam )
{
  if( ULIsSynchronizeMessage( uMsg ) ) {
    DoSync();
    if( wParam == 1 ) DestroyWindow( hWnd );
    return 0;
  }
  switch( uMsg ) {
  // code to handle other windows messages
  default:
    return DefWindowProc( hwnd, uMsg, wParam, lParam );
  }
  return 0;
}

其中 DoSync 是实际调用 ULSynchronize 的方法。

 另请参见