Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > extending Python error

Reply
Thread Tools

extending Python error

 
 
Ajay
Guest
Posts: n/a
 
      09-04-2004
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





----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
 
Reply With Quote
 
 
 
 
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Guest
Posts: n/a
 
      09-04-2004
Ajay wrote:
> 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
 
Reply With Quote
 
 
 
 
Ajay
Guest
Posts: n/a
 
      09-05-2004
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


Quoting "\"Martin v. Löwis\"" <>:

> Ajay wrote:
> > i think that might be it. what would i need to change in Python.h to

> remove
> > the errors?

>
> I don't know. We would need to understand the problem in detail first.
>
> Martin
>



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
 
Reply With Quote
 
=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
Guest
Posts: n/a
 
      09-05-2004
Ajay wrote:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in Extending/Embedding FAQ, point 16: How do I tell"incomplete input" from "invalid input"? Dietrich Bollmann Python 0 04-22-2008 03:12 PM
return tuple from C to python (extending python) Kiran Python 5 10-26-2006 12:55 PM
return tuple from C to python (extending python) Kiran C Programming 3 10-26-2006 12:55 PM
extending python: which python code calls the c iterator methods? Johannes Zellner Python 1 01-18-2006 12:22 PM
Extending python - undefined symbol error on import ch424 Python 3 07-25-2005 08:28 AM



Advertisments