Problem instantiating COleVariant in eVC++ 4.0
- From: the.tarquin@xxxxxxxxx
- Date: Thu, 07 Jun 2007 21:55:31 -0000
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
.
- Follow-Ups:
- Re: Problem instantiating COleVariant in eVC++ 4.0
- From: the . tarquin
- Re: Problem instantiating COleVariant in eVC++ 4.0
- Prev by Date: Re: I2C source code from pxa270
- Next by Date: Re: Problem instantiating COleVariant in eVC++ 4.0
- Previous by thread: I2C source code from pxa270
- Next by thread: Re: Problem instantiating COleVariant in eVC++ 4.0
- Index(es):
Relevant Pages
|
Loading