Click here to Skip to main content
11,790,613 members (63,252 online)
Click here to Skip to main content

How to load a tree view with a large XML file (Pocket PC version of Frank Le's program)

, 17 Apr 2003 CPOL 57.5K 175 23
Rate this:
Please Sign up or sign in to vote.
Using XML on the Pocket PC is almost as easy as on a Desktop. You only need to make a few magic calls and voila, you have it!

Sample Image - CETreeView.jpg


This is the Pocket PC version of Frank Le's, "How to load a tree view with a large XML file". I got permission from Frank to post the CE or Pocket PC version of his program. It's been a couple of months after I implemented the Pocket PC version and never had time, until now, to document and upload it. It's now over a year later, so here goes.

Initializing COM:


Next, the following bit of code must be executed. But I don't remember why. It's something about document safety options. If someone does know, please post the reason.

/* Pocket PC workaround:
    Remove document safety options  */
 IObjectSafety* pSafety;
 DWORD  dwSupported, dwEnabled;
 if ( SUCCEEDED(document->QueryInterface( IID_IObjectSafety,
       (void**)&pSafety ) ) )
     &dwSupported, &dwEnabled );
     dwSupported, 0 );

The following code uses the FileStream to load an XML file into the DOM. You need to get the FileStream.h file for this (included in the zip file).

 VARIANT_BOOL   vSuccess;

 VariantInit( &vXMLSrc );

 /* to load an XML file from a local file use the following code */
 FileStream* fs = new FileStream;
 vXMLSrc.punkVal = fs;
 hr = document->load(vXMLSrc, &varOkay);
 if (FAILED(hr))
  return FALSE;



is replaced with:

  if (vbHasChild) {

I have forgotten why, and it may not be necessary. The code does work though. I have included an ARM exe with the zip file.

I used the DOM in some of my programs here and it worked pretty well.


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


About the Author

mark edwards
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

Questionhow to make the application available for dialog? Pin
tianbawudiku30-Jun-06 3:12
membertianbawudiku30-Jun-06 3:12 
GeneralFlash Drive Pin
auburnate26-May-04 5:43
memberauburnate26-May-04 5:43 
GeneralSample Pin
ponshio18-Sep-03 7:23
memberponshio18-Sep-03 7:23 
GeneralMy experience ... Pin
Daniel S.19-Apr-03 6:44
memberDaniel S.19-Apr-03 6:44 
Generalno ARM exe in zipfile! Pin
ferdo18-Apr-03 7:52
memberferdo18-Apr-03 7:52 
GeneralRe: no ARM exe in zipfile! Pin
mark edwards18-Apr-03 8:02
membermark edwards18-Apr-03 8:02 

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
Web02 | 2.8.1509028.1 | Last Updated 18 Apr 2003
Article Copyright 2003 by mark edwards
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid