SyncService.h 939 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "stdafx.h"
  3. #ifdef SYNCSERVICE_EXPORTS
  4. #define SYNCSERVICE_API __declspec( dllexport )
  5. #else
  6. #define SYNCSERVICE_API __declspec(dllimport)
  7. #pragma comment(lib, "SyncService.lib")
  8. #endif
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. SYNCSERVICE_API int StartSyncService(char * szAddr,int nPort);
  13. SYNCSERVICE_API int StopSyncService();
  14. SYNCSERVICE_API int RefreshWindow();
  15. struct ISyncControl
  16. {
  17. virtual BOOL Start() = 0;
  18. virtual BOOL Stop() = 0;
  19. };
  20. typedef void (*OnRecvPacket)(int sub_type, const void *buf, int size, void *user_data);
  21. struct INetCommunication
  22. {
  23. virtual BOOL Send(int sub_type, const void *buf, int size) = 0;
  24. virtual BOOL RegisterRecvCB(OnRecvPacket cb, void *user_data) = 0;
  25. virtual void OnAgentInput() = 0;
  26. };
  27. SYNCSERVICE_API ISyncControl* GetControlObject(INetCommunication *pComm, HWND hWndBrowser);
  28. SYNCSERVICE_API void FreeControlObject(ISyncControl* pControl);
  29. #ifdef __cplusplus
  30. }
  31. #endif