/************************************************************************************************************ 작성자 : newtype 최종 수정일 : 2003.08.08 설명 : SQLCE의 병합복제기능을 위한 클래스 환경 : SQLCE 2.0, EVC 3.0 테스트 : Windows 2000, Windows XP, EVC3.0, PPC3.0, PPC2002, ADOCE 3.1 사용 방법 : // 접속 CCEMerge cemerge; cemerge.InitializeReplication(); cemerge.SetInternet( L"http://192.168.0.2/Mobile/sscesa20.dll", L"", L"" ); cemerge.SetPublication( L"Northwind", L"Northwind", L"TESTSERVER", L"sa", L"sa", TRUE ); HRESULT hresult = cemerge.SetSubscriber( L"newtype", L"\\Northwind.sdf" ); if ( SUCCEEDED(hresult) ) { hresult = cemerge.Synchronize(); cemerge.TerminateReplication(); } else { MessageBox( L"DB 싱크에 실패했습니다.!", L"에러", MB_ICONSTOP ); return; } /**************************************************************************************************************/ #define INC_OLE2 #define INITGUID #include #define MAX_CONNECTSTRING 512 #define MAX_NAMELENGTH 255 #define MAX_URLLENTTH 255 #define MAX_QUERYSTRING 1024 class CCEMerge { public: CCEMerge(); ~CCEMerge(); ISSCEMerge* m_pCEMerge; void InitializeReplication(); void TerminateReplication(); HRESULT SetInternet( LPTSTR wszInternetURL, LPTSTR wszInternetLogin, LPTSTR wszInternetPassword ); HRESULT SetPublication( LPTSTR wszPublication, LPTSTR wszPublisherDatabase, LPTSTR wszPublisher, LPTSTR wszPublisherLogin, LPTSTR wszPublisherPassword, BOOL bAuthDB ); HRESULT SetDistributor( LPTSTR wszDistributor, LPTSTR wszDistributorLogin, LPTSTR wszDistributorPassword, BOOL bAuthDB ); HRESULT SetSubscriber( LPTSTR wszSubscriber, LPTSTR wszSubscriberLocalFilePath, LPTSTR wszHostName = L"", BOOL bCreateDatabase = TRUE ); HRESULT AddSubscription(LPTSTR wszSubscriberLocalFilePath, LPTSTR wszHostName = L"", BOOL bCreateDatabase = TRUE ); HRESULT Synchronize(); void ShowMergeErrors(WCHAR* pwszCaption); private: void CreateDirectory4ThisFile( LPTSTR wszLocalFilePath ); LPTSTR OnlyDirecory(LPTSTR strFull); };