extending Python error

A

Ajay

hi!

I have a c++ file that does some XML processing (visual c++ using ATL). The
file builds fine. However when i add the header #include<Python.h>, i get a
number of errors
C:\Windows CE Tools\wce300\Pocket PC 2002\atl\include\atlbase.h(5395) :
error C2664: '__WinCE_OutputDebugStringA' : cannot convert parameter 1
from 'const unsigned short *' to 'const char *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast
C:\Windows CE Tools\wce300\Pocket PC 2002\atl\include\atlbase.h(5396) :
error C2664: '__WinCE_OutputDebugStringA' : cannot convert parameter 1
from 'unsigned short [4]' to 'const char *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast

any ideas where the errors are coming from?

thanks
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Ajay said:
C:\Windows CE Tools\wce300\Pocket PC 2002\atl\include\atlbase.h(5395) :
error C2664: '__WinCE_OutputDebugStringA' : cannot convert parameter 1
from 'const unsigned short *' to 'const char *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast [...]

any ideas where the errors are coming from?

Could it be that WCHAR_T is not unsigned short on Windows CE?

Regards,
Martin
 
A

Ajay

well the problem is:
i am trying to do some xml processing on the PDA. i plan to do it in C++
using msxml and then provide a Python wrapper around it.
the code below just loads up a simple XML file and parses it.
#include <Python.h>
#include <windows.h>
#include <msxml.h>
#include <atlbase.h>
#include <afx.h>
#include <afxdisp.h>

void LoadXML(CString sFilePath)
{
CComPtr<IXMLDOMDocument> pXMLDoc;
pXMLDoc.CoCreateInstance(__uuidof(DOMDocument));
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);
}

this works perfectly fine until i include the Python.h header at which
moment i get a whole list of errors. the errors are raised in atlbase.h
and are all the same
C:\Windows CE Tools\wce300\Pocket PC 2002\atl\include\atlbase.h(5395) :
error C2664: '__WinCE_OutputDebugStringA' : cannot convert parameter 1
from 'const unsigned short *' to 'const char *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast
C:\Windows CE Tools\wce300\Pocket PC 2002\atl\include\atlbase.h(5396) :
error C2664: '__WinCE_OutputDebugStringA' : cannot convert parameter 1
from 'unsigned short [4]' to 'const char *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast

i think there is something that needs to be changed in Python.h for this to
work but have no idea what it is.

cheers
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

Ajay said:
C:\Windows CE Tools\wce300\Pocket PC 2002\atl\include\atlbase.h(5395) :
error C2664: '__WinCE_OutputDebugStringA' : cannot convert parameter 1
from 'const unsigned short *' to 'const char *'
Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast

So what is line 5395 of atlbase.h?

Regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top