[C++-sig] wrapping a function that takes a void*

Matthew Scouten matthew.scouten at gmail.com
Fri Oct 12 18:18:30 CEST 2007


I am wraping a function that takes a void* as an argument.

class Special
{
	int fooRequest(void * userData = NULL);
	virtual void fooCallback(void * userData)
}

The intention is that the user data pointer will be returned to
'remind' the program what callback goes with what request.

my first attempt:

struct Special_wrapper: Special, wrapper<Special>
{
	int fooRequest(PyObject * userData = NULL);
}

int Special_wrapper::fooRequest(PyObject * userData)
{
	return  fooRequest((void*) userData)
}


and later

class<Special_wrapper>("Special")
	.def("fooRequest" ,&Special_wrapper::fooRequest	,(arg("userData") =
(void*)NULL))


I get a error the first line of which is:
C:\Documents and
Settings\mscouten\Desktop\boost_1_32_0\boost_1_32_0\boost/python/converter/arg_to_python.hpp(181)
: error C2027: use of undefined type
'boost::python::converter::detail::cannot_convert_raw_PyObject<T>'

(Full error text available on request)

Does any body have any recommendations about how I could wrap this.



More information about the Cplusplus-sig mailing list