Skip to main content

Past Blast

Featured Products

Windows Mobile Developer Controls
Windows Mobile Developer Controls
Stay in touch using the DEVBUSS RSS feeds.
 

News

Windows Mobile Developer Controls
Sapphire Soltuions

Getting Started with XML in eVB

Written by Jim Poe  [author's bio]  [read 60151 times]
Edited by Derek

Download the code

Page 1  Page 2  Page 3 

[Related article: Generating eVB forms from XML documents]

Introduction

There is sparse documentation regarding XML and Windows CE, and the majority of the information out there addresses the use of XML with Pocket Internet Explorer. In fact, the Embedded Developer documentation on MSDN explicitly states that XML is only supported when used with PIE, which helps to explain why there are no eVB or eVC XML examples in the documentation. Even without sample code, using XML from Embedded Visual Basic is very simple and, in this tutorial, I will outline the steps necessary to get up and running using the XML document object model. I'll also step through some code that loads the contents of an XML file into a Grid control.

Setting Up The Development Environment

Windows CE supports Microsoft XML 2.0 with a few minor differences from the desktop version. The first step for configuring the eVB environment to use XML is to set a reference to the desktop version of the msxml 2.0 dll. Although this is not strictly necessary for creating the XML objects, I find it useful, because it gives you the ability to navigate the MSXML object model with the Object Browser and enables IntelliSense for MSXML properties and methods [footnote: Please note that there may be inconsistencies between the desktop version of the XML object model and the actual XML object model found on Windows CE.]. If you have Microsoft XML 2.0 installed on your development machine, then you can do this by clicking Project -> References and then browsing to the location of the msxml.dll file. On my machine it's C:\winnt\system32\msxml.dll

This will cause and error message to be displayed stating that the dll is not compatible for the current platform, but just ignore it and click "OK".

After you do this the first time, "Microsoft XML, version 2.0" will appear in the list of available references for all new projects. The next step is to add a reference to the "Microsoft CE File System Control 3.0". The file control is necessary to workaround a bug in the load method of the DOMDocument object.

Next Page