Click here to Skip to main content
Click here to Skip to main content
Go to top

C++ wrapper for ADOCE filtering

, 31 Aug 2002
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++ PinmemberMichelly040510-Sep-07 8:28 
Questioncan not overwrite .cdb file in my device [modified] Pinmembersaygogogo11-Oct-06 4:15 
GeneralDevicetodesktop - Desktoptodevice and WM5 Pinmemberjsoftmonopoli6-Jul-06 21:41 
GeneralThe doxygen link leads to a domain squatter Pinmemberowbear@dodgeit.com31-Aug-05 0:14 
GeneralProblem with Seek() method Pinmembergeorgeivanov9-Oct-03 1:01 
QuestionHow to get Device Desktop to Pc? PinmemberNoohsamui23-Sep-03 21:32 
QuestionWhen does the instance of CAdoFiltr get deleted ? PinmemberRay Kinsella12-Jun-03 23:40 
AnswerRe: When does the instance of CAdoFiltr get deleted ? PinmemberTanzim Husain30-Jun-03 0:36 
GeneralRe: When does the instance of CAdoFiltr get deleted ? Pinmemberdeborabeatriz25-Aug-03 20:59 
Generallittle promblem here Pinmembercdextraze24-Apr-03 10:29 
GeneralSyncronizing database between PC and Pocket PC 2002 PinmemberLoron26-Mar-03 2:59 
GeneralRe: Syncronizing database between PC and Pocket PC 2002 PinmemberJoão Paulo Figueira26-Mar-03 23:00 
GeneralRe: Syncronizing database between PC and Pocket PC 2002 PinmemberLoron27-Mar-03 3:59 
QuestionCould you please provide some sample code about using ADOCE in PPC? PinmemberBui Huy Kien23-Feb-03 18:14 
GeneralUnicode PinmemberJoão Paulo Figueira29-Jan-03 4:51 
GeneralRe: Unicode PinmemberNathan Lewis13-Mar-07 6:18 
GeneralWow - I'm flattered! PinmemberNathan Lewis10-Sep-02 6: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 | Mobile
Web02 | 2.8.140916.1 | Last Updated 1 Sep 2002
Article Copyright 2002 by Olivier Gaumond
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid