5,138,005 members and growing! (13,714 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Mobile Development » Database     Intermediate

C++ wrapper for ADOCE filtering

By Olivier Gaumond

A simple class to use the DesktopToDevice and DeviceToDesktop functions from a C++ project.
VC6, VC7, C++, Windows, WinCE, CE 3.0, Visual Studio, PDA, MFC, Dev

Posted: 31 Aug 2002
Updated: 31 Aug 2002
Views: 63,504
Announcements



Search    
Advanced Search
Sitemap
10 votes for this Article.
Popularity: 4.15 Rating: 4.15 out of 5
0 votes, 0.0%
1
0 votes, 0.0%
2
0 votes, 0.0%
3
2 votes, 33.3%
4
4 votes, 66.7%
5

Overview

The DesktopToDevice and DeviceToDesktop functions allows 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.

Eg:

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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Olivier Gaumond



Occupation: Web Developer
Location: Canada Canada

Other popular Mobile Development articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 17 of 17 (Total in Forum: 17) (Refresh)FirstPrevNext
Subject  Author Date 
QuestionDo it in VC++memberMichelly04059:28 10 Sep '07  
Questioncan not overwrite .cdb file in my device [modified]membersaygogogo5:15 11 Oct '06  
GeneralDevicetodesktop - Desktoptodevice and WM5memberjsoftmonopoli22:41 6 Jul '06  
GeneralThe doxygen link leads to a domain squattermemberowbear@dodgeit.com1:14 31 Aug '05  
GeneralProblem with Seek() methodmembergeorgeivanov2:01 9 Oct '03  
GeneralHow to get Device Desktop to Pc?memberNoohsamui22:32 23 Sep '03  
GeneralWhen does the instance of CAdoFiltr get deleted ?memberRay Kinsella0:40 13 Jun '03  
GeneralRe: When does the instance of CAdoFiltr get deleted ?memberTanzim Husain1:36 30 Jun '03  
GeneralRe: When does the instance of CAdoFiltr get deleted ?memberdeborabeatriz21:59 25 Aug '03  
Generallittle promblem heremembercdextraze11:29 24 Apr '03  
GeneralSyncronizing database between PC and Pocket PC 2002memberLoron3:59 26 Mar '03  
GeneralRe: Syncronizing database between PC and Pocket PC 2002memberJoão Paulo Figueira0:00 27 Mar '03  
GeneralRe: Syncronizing database between PC and Pocket PC 2002memberLoron4:59 27 Mar '03  
GeneralCould you please provide some sample code about using ADOCE in PPC?memberBui Huy Kien19:14 23 Feb '03  
GeneralUnicodememberJoão Paulo Figueira5:51 29 Jan '03  
GeneralRe: UnicodememberNathan Lewis7:18 13 Mar '07  
GeneralWow - I'm flattered!memberNathan Lewis7:17 10 Sep '02  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 31 Aug 2002
Editor: Chris Maunder
Copyright 2002 by Olivier Gaumond
Everything else Copyright © CodeProject, 1999-2008
Web07 | Advertise on the Code Project