Click here to Skip to main content
11,488,646 members (75,102 online)
Click here to Skip to main content

C++ wrapper for ADOCE filtering

, 31 Aug 2002 CPOL 87K 153 25
Rate this:
Please Sign up or sign in to vote.
A simple class to use the DesktopToDevice and DeviceToDesktop functions from a C++ project.

Overview

The DesktopToDevice and DeviceToDesktop functions allow you to transfer and/or synchronize MS Access databases (.mdb files) to a Windows CE device (.cdb files). These functions were designed to be used from Visual Basic, however it is still possible to call them from C++ projects by locating the function in the dll.

The original code was written by Nathan Lewis (nlewis@programmer.net, http://www.ticz.com/~nlewis) I simply reorganized the functions in a class to make it easy to use from MFC projects. I use the Singleton pattern to ensure that the class is only instanciated once and the dll gets loaded only one time.

Usage

To use the class in your project you simply need to include it in your project. To get an instance of the CAdoFiltr class you must use the getInstance() function, you can't use the constructor since it is protected. For more information on the parameters you can pass to DesktopToDevice and DeviceToDesktop see MSDN.

E.g.:

CAdoFiltr* pAdoFiltr = CAdoFiltr::getInstance();

HRESULT hr = pAdoFiltr->DesktopToDevice("c:\\database\\test.mdb",
		"tblTest..!tblTest2..", 
		false, true, "\\My Documents\\test.cdb");

if (hr != S_OK)
{
	//transfer has failed
}

I tested the code under Windows NT 4 Workstation with ActiveSync 3.5 and an iPAQ 3650 running PocketPC 2000

Documentation

The documentation files were generated by doxygen, it explains the strange tags in the comment blocks through the code.

  • For more information about ADOCE and the DesktopToDevice and DeviceToDesktop functions see MSDN.
  • For more information about using these functions from C/C++ see the original contribution from Nathan Lewis.
  • For more information about the Singleton pattern you can have a look to Pattern Digest.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Olivier Gaumond
Web Developer
Canada Canada
No Biography provided

Comments and Discussions

 
QuestionDo it in VC++ Pin
Michelly040510-Sep-07 9:28
memberMichelly040510-Sep-07 9:28 
Questioncan not overwrite .cdb file in my device [modified] Pin
saygogogo11-Oct-06 5:15
membersaygogogo11-Oct-06 5:15 
GeneralDevicetodesktop - Desktoptodevice and WM5 Pin
jsoftmonopoli6-Jul-06 22:41
memberjsoftmonopoli6-Jul-06 22:41 
GeneralThe doxygen link leads to a domain squatter Pin
owbear@dodgeit.com31-Aug-05 1:14
memberowbear@dodgeit.com31-Aug-05 1:14 
GeneralProblem with Seek() method Pin
georgeivanov9-Oct-03 2:01
membergeorgeivanov9-Oct-03 2:01 
QuestionHow to get Device Desktop to Pc? Pin
Noohsamui23-Sep-03 22:32
memberNoohsamui23-Sep-03 22:32 
QuestionWhen does the instance of CAdoFiltr get deleted ? Pin
Ray Kinsella13-Jun-03 0:40
memberRay Kinsella13-Jun-03 0:40 
AnswerRe: When does the instance of CAdoFiltr get deleted ? Pin
Tanzim Husain30-Jun-03 1:36
memberTanzim Husain30-Jun-03 1:36 
GeneralRe: When does the instance of CAdoFiltr get deleted ? Pin
deborabeatriz25-Aug-03 21:59
memberdeborabeatriz25-Aug-03 21:59 
Generallittle promblem here Pin
cdextraze24-Apr-03 11:29
membercdextraze24-Apr-03 11:29 
GeneralSyncronizing database between PC and Pocket PC 2002 Pin
Loron26-Mar-03 3:59
memberLoron26-Mar-03 3:59 
GeneralRe: Syncronizing database between PC and Pocket PC 2002 Pin
João Paulo Figueira27-Mar-03 0:00
memberJoão Paulo Figueira27-Mar-03 0:00 
GeneralRe: Syncronizing database between PC and Pocket PC 2002 Pin
Loron27-Mar-03 4:59
memberLoron27-Mar-03 4:59 
QuestionCould you please provide some sample code about using ADOCE in PPC? Pin
Bui Huy Kien23-Feb-03 19:14
memberBui Huy Kien23-Feb-03 19:14 
GeneralUnicode Pin
João Paulo Figueira29-Jan-03 5:51
memberJoão Paulo Figueira29-Jan-03 5:51 
GeneralRe: Unicode Pin
Nathan Lewis13-Mar-07 7:18
memberNathan Lewis13-Mar-07 7:18 
GeneralWow - I'm flattered! Pin
Nathan Lewis10-Sep-02 7:17
memberNathan Lewis10-Sep-02 7:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150520.1 | Last Updated 1 Sep 2002
Article Copyright 2002 by Olivier Gaumond
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid