473,387 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

extending Python error

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.
Jul 18 '05 #1
3 1880
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
Jul 18 '05 #2
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\"" <ma****@v.loewis.de>:
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.
Jul 18 '05 #3
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
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Alicia Haumann | last post by:
I accidentally sent this to webmaster@python.org, so this could be a duplicate if "webmaster" forwards it to this list. :{ Hi, there. Thanks for any help that can be offered. I've been...
0
by: Hugh Macdonald | last post by:
I've got a slight problem... and I'm stuck as to where to go with it... I'm running on Redhat7.2, using Python 2.2.2 I've got a compiled module that I wrote almost a year ago - it works fine,...
3
by: ch424 | last post by:
Hi there, I'm using Python 2.4.1 on Ubuntu Linux, and I'm having problems extending python in C: The C code is below: #include <Python.h> #include "ni488.h"
1
by: Richard Townsend | last post by:
In the "Extending and Embedding" part of the Python documentation: section 5.4 "Extending Embedded Python" - it describes how to use a Python extension module from Python that is embedded in a C...
3
by: Marco Meoni | last post by:
Hi all! I've a problem with a C++ class that has to be included in a python application. One way to do it is Extending and Embedding the Python Interpreter Now i have 2 questions 1) Is there a...
5
by: vbgunz | last post by:
Hello everyone. I own two books. Learning Python and Python in a nutshell. When cross referencing the two books to try and clarify the ideas behind extending methods and delegates, this is where...
1
by: jeremito | last post by:
I am trying to learn how to extend and/or embed Python. I have looked at the document "Extending and Embedding the Python Interpreter" and also "Python/C API Reference Manual. In the examples...
0
by: vishnu | last post by:
Hello All, I have embedded python 2.5 in to my C application. As we need the python scripts to run in multi threaded environment I have used Py_NewInterpreter() and Py_EndInterpreter each time I...
7
by: Maximus Decimus | last post by:
HI all, I am using python v2.5 and I am an amateur working on python. I am extending python for my research work and would like some help and guidance w.r.t this matter from you experienced...
0
by: Tim Spens | last post by:
--- On Fri, 6/27/08, Tim Spens <t_spens@yahoo.comwrote: I think I know where the problem is but I'm unsure how to fix it. When I call Register_Handler(...) from python via...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.