Problem instantiating COleVariant in eVC++ 4.0



Hi everyone,

I'm developing an app for Windows CE 4.2, using eVC++ 4.0. The app
takes as input an XML file and so I'm trying to make use of the MSXML
parser. I found what seems to be a pretty good tutorial (http://
www.developer.com/ws/pc/article.php/3098331). The problem I'm having,
however, is that the compiler chokes on the code snippet the author
gives for loading an XML file.

[CODE]
//MMXMLParser.cpp
#include "StdAfx.h"
#include "MMXMLParser.h"

void MMXMLParser::LoadXML(string sFilePath)
{
IXMLDOMDocumentPtr pXMLDoc;
COleVariant vXmlFile(sFilePath);
VARIANT_BOOL vSuccess;

HRESULT hr = pXMLDoc.CoCreateInstance(__uuidof (DOMDocument));
pXMLDoc->put_validateOnParse(VARIANT_FALSE);
pXMLDoc->put_resolveExternals(VARIANT_FALSE);
pXMLDoc->put_preserveWhiteSpace(VARIANT_FALSE);
hr = pXMLDoc->load(vXmlFile,&vSuccess);
}
....

//MMXMLParser.h
#include <string>
#include <xmlparser.h>
#include <msxml.h>
#include <atlbase.h>
#include <stdio.h>
using namespace std;
....
typedef CComPtr<IXMLDOMDocument> IXMLDOMDocumentPtr;
typedef CComPtr<IXMLDOMNode> IXMLDOMNodePtr;
typedef CComPtr<IXMLDOMNodeList> IXMLDOMNodeListPtr;
typedef CComPtr<IXMLDOMNode> IXMLDOMNodePtr;

class MMXMLParser
{
//Loads and parses the XML file
void LoadXML(string sFilePath);
....
};

[/CODE]

The errors that the compiler produces are:
[ERRORS]
MMXMLParser.cpp
L:\pnapi\util\ERTManufacturer\MMXMLParser.cpp(12) : error C2065:
'COleVariant' : undeclared identifier
L:\pnapi\util\ERTManufacturer\MMXMLParser.cpp(12) : error C2146:
syntax error : missing ';' before identifier 'vXmlFile'
L:\pnapi\util\ERTManufacturer\MMXMLParser.cpp(12) : error C2065:
'vXmlFile' : undeclared identifier
[/ERRORS]

Those are the only three errors the compiler throws. I have the
project set to use MFC in a shared .dll, but since it's a command-line
app, I didn't create it initially as an MFC application because of all
the project cruft that this tends to generate.

Any help or advice anyone can offer in getting past these errors,
working around these errors, or regarding XML parsing in eVC++ for
WinCE 4.2 would be greatly appreciated.

Thanks,
Aaron M Brown

.



Relevant Pages

  • Re: For Ilya Tumanov
    ... i mount the App in the iPAQ and works ok... ... "David Fúnez" wrote in message ... >> VS would redeploy and overwrite modified XML file. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: WinForms and local DB
    ... XML file as physical storage and read all data in XML file into DataSet and ... have the DataSet stay in momery when the Windows app is running. ... > spoiled by SQL Server and SQL Server CE. ... > would be if I could make something like SQL Server CE local database work ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: How to pass Application.Item value back to class?
    ... I just noticed that your message did mention that your prlbme was with ... Other classes must refer to the static "Current" member of ... > Suggestions please for strategy to share values across app. ... The xml file has different nodes for different ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Support of a large table
    ... > display different parts within different controls of a vb app. ... > One part of the XML file identifies information about processor cylces. ... > demanding on memory. ...
    (comp.lang.basic.visual.misc)

Loading