Click here to Skip to main content
Click here to Skip to main content

C++ wrapper for ADOCE filtering

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


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 (, 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.


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.


CAdoFiltr* pAdoFiltr = CAdoFiltr::getInstance();

HRESULT hr = pAdoFiltr->DesktopToDevice("c:\\database\\test.mdb",
		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


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.


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


About the Author

Olivier Gaumond
Web Developer
Canada Canada
No Biography provided

Comments and Discussions

QuestionDo it in VC++ PinmemberMichelly040510-Sep-07 9:28 
Questioncan not overwrite .cdb file in my device [modified] Pinmembersaygogogo11-Oct-06 5:15 
GeneralDevicetodesktop - Desktoptodevice and WM5 Pinmemberjsoftmonopoli6-Jul-06 22:41 
GeneralThe doxygen link leads to a domain squatter Pinmemberowbear@dodgeit.com31-Aug-05 1:14 
GeneralProblem with Seek() method Pinmembergeorgeivanov9-Oct-03 2:01 
QuestionHow to get Device Desktop to Pc? PinmemberNoohsamui23-Sep-03 22:32 
QuestionWhen does the instance of CAdoFiltr get deleted ? PinmemberRay Kinsella13-Jun-03 0:40 
AnswerRe: When does the instance of CAdoFiltr get deleted ? PinmemberTanzim Husain30-Jun-03 1:36 
GeneralRe: When does the instance of CAdoFiltr get deleted ? Pinmemberdeborabeatriz25-Aug-03 21:59 
Generallittle promblem here Pinmembercdextraze24-Apr-03 11:29 

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
Web04 | 2.8.150414.1 | Last Updated 1 Sep 2002
Article Copyright 2002 by Olivier Gaumond
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid