extending Python error

Discussion in 'Python' started by Ajay, Sep 4, 2004.

  1. Ajay

    Ajay Guest

    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.
    Ajay, Sep 4, 2004
    #1
    1. Advertising

  2. 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
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Sep 4, 2004
    #2
    1. Advertising

  3. Ajay

    Ajay Guest

    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.
    Ajay, Sep 5, 2004
    #3
  4. 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
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Sep 5, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ch424
    Replies:
    3
    Views:
    606
    ch424
    Jul 25, 2005
  2. Johannes Zellner
    Replies:
    1
    Views:
    328
    Fredrik Lundh
    Jan 18, 2006
  3. Kiran
    Replies:
    5
    Views:
    278
    Kiran
    Oct 26, 2006
  4. Kiran
    Replies:
    3
    Views:
    617
    Kiran
    Oct 26, 2006
  5. Dietrich Bollmann
    Replies:
    0
    Views:
    339
    Dietrich Bollmann
    Apr 22, 2008
Loading...

Share This Page