I have a simple C++ library (from a dll) I am attempting to make accessible
through bindings to python. I used Py++ to generate some boost code for the
library that I compiled into a pyd. I can import the pyd no problem into
python, but I can't seem to call the functions.

struct MM_Api
void* pData;

int declspec(dllimport) MM_Initialize( MM_Api* pApi );

I made a PyMM.pyd that has this in it.

import PyMM
api = PyMM.MM_Api
ret = PyMM.MM_Initialize(api)

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
Boost.Python.ArgumentError: Python argument types in
did not match C++ signature:
MM_Initialize(struct MM_Api * pApi)

The docs for Py++ leave a lot guess work up to the user, so I don't know if I
forgot a step, or messed something up. Is there some glue I need to
write/generate that will translate an instance of PyMM.MM_Api to the C++
version of MM_Api, and if so, is this python glue, or C/C++ glue?

Thank you

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
grouppython-list @
postedJun 10, '10 at 3:15p
activeJun 10, '10 at 3:50p

2 users in discussion

Murrgon: 1 post Thomas Jollans: 1 post



site design / logo © 2021 Grokbase