[C++-sig] Weird problem with opaque pointers and pointers by reference

2012-09-24 Thread Giuseppe Corbelli
) { return new OPAQUE(); } void destroyer(OPAQUE*& x) { delete (x); x = NULL; } img = CameraConnect_Fake_Python.FACTORY() CameraConnect_Fake_Python.DESTROYER(img) It runs correctly! Hope someone can help... -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.

Re: [C++-sig] export custom C++ exception to Python so it can be raisedby python

2012-11-06 Thread Giuseppe Corbelli
o need to keep anything in sync. 2) you can base the Python exception on the standard PyExc_Exception but use PyErr_SetObject in the exception translator. A quick search finds this http://stackoverflow.com/questions/2261858/boostpython-export-custom-exception (does not inherit from Exception,

Re: [C++-sig] export custom C++ exception to Python so it can beraisedby python

2012-11-06 Thread Giuseppe Corbelli
oes work even if you have wrapped MyException as a standard class. -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666318 Fax: +390302659932 E-mail: giuseppe.corbe...@copanitalia.com ___ Cpluspl

Re: [C++-sig] export custom C++ exception to Python so it can beraisedbypython

2012-11-07 Thread Giuseppe Corbelli
fine a new C++ exception CustomException based on std::exception *) Register a translator from C++ to python using CustomError as a target Seems a reasonable approach. -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666318 Fax: +390302659932 E-mail: giuseppe.

Re: [C++-sig] Boost.Python - Passing boost::python::object as argumentto python function?

2012-12-06 Thread Giuseppe Corbelli
d serve somehow like a "__dict__" on the C++ side. -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666318 Fax: +390302659932 E-mail: giuseppe.corbe...@copanitalia.com ___ Cplusplus-sig mailing list Cp

Re: [C++-sig] to_python converter and make_getter

2013-01-23 Thread Giuseppe Corbelli
ticStdString; } First you register the converter(s). Second you instantiate the one and only A_Wrap. Everytime you access staticStdString just return A_Wrap::staticStdString. -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666318 Fax: +390302659932 E-mail

Re: [C++-sig] question on boost.python exception mechanisms

2013-03-28 Thread Giuseppe Corbelli
exception would raise from the event loop, unless catched while calling the callback function pointer. Sidenote: how does the C++ exception mechanism work under the hood? What happens if it's called inside a C compiled function? -- Giuseppe Corbelli WASP Software Engineer, Copan

Re: [C++-sig] question on boost.python exception mechanisms

2013-04-08 Thread Giuseppe Corbelli
On 03/04/2013 10:08, Holger Joukl wrote: Hi Giuseppe, thanks for answering and sorry for the delayed response. Easter holidays :-) To punish you here's another late reply. Giuseppe Corbelli wrote on 28.03.2013 09:37:39: On 26/03/2013 18:51, Holger Joukl wrote: Hi, I'm wr

Re: [C++-sig] question on boost.python exception mechanisms

2013-04-09 Thread Giuseppe Corbelli
uot; the objects from the shared .so. Maybe playing dirty with LD_PRELOAD? -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666318 Fax: +390302659932 E-mail: giuseppe.corbe...@copanitalia.com ___ Cplusplus-sig m

Re: [C++-sig] Boost python simple interfacing

2013-09-24 Thread Giuseppe Corbelli
brary. Your extension module needs to access the Command Manager, so make sure it has already been initialized before the module is loaded, else the GetCommandManager() may return NULL. -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666318 Fax: +390302

Re: [C++-sig] Boost python simple interfacing

2013-09-27 Thread Giuseppe Corbelli
out module support, and link everything static. I just don't know how much work would it take. -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666318 Fax: +390302659932 E-mail: giuseppe.corbe...@copanitalia.com __

Re: [C++-sig] How to handle argument error exceptions in boost.python?

2014-01-14 Thread Giuseppe Corbelli
function_args) did not match C++ signature: cpp_function_name(cpp_args) -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666318 Fax: +390302659932 E-mail: giuseppe.corbe...@copanitalia.com ___ Cplusplus-sig mailing

Re: [C++-sig] How to handle argument error exceptions in boost.python?

2014-01-14 Thread Giuseppe Corbelli
C++ code object and ValueError (I think) when the C++ code object raises an exception without a specific C++ to python exception translator installed. -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666318 Fax: +390302659932 E-mail: giuseppe.corbe...@

Re: [C++-sig] PhysX3.x Wrapping Problems

2014-01-29 Thread Giuseppe Corbelli
Foundation. *Notes: * - physx comes as SDK: only Headers, libs and dlls. Before reading on I'd investigate the "no RTTI data" message. Make sure you're using the /GR compiler option. -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666

Re: [C++-sig] boost.python built with VC2010

2014-09-29 Thread Giuseppe Corbelli
crt) and it's not a good idea. Don't have any reference at hand right now, sorry. -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666318 Fax: +390302659932 E-mail: giuseppe.corbe...@copanitalia.com

Re: [C++-sig] Passing std::wstring to Python callback

2015-04-03 Thread Giuseppe Corbelli
r(x.data(),implicit_cast(x.size())), &PyUnicode_Type) # endif PyUnicode_FromWideChar returns NULL on failure, so a SEGV may as well be expected. AFAIK an UTF16 encoding should be OK. -- Giuseppe Corbelli WASP Software Engineer, Copan Italia S.p.A Phone: +390303666318 Fax: +39

Re: [C++-sig] Boost Python in dynamic libraries

2015-11-25 Thread Giuseppe Corbelli
fined in Python/pystate.c and initialized as NULL. In Python/pythonrun.c within Py_InitializeEx() call a new thread state is initialized and PyThreadState_Swap() sets it. In short: I'd say you didn't call Py_Initialize() before dlopen()ing the shared objects. -- Giusep

Re: [C++-sig] Stand-alone Boost.Python

2016-06-20 Thread Giuseppe Corbelli
mic\threading-multi \test\andreas_beyer.cpp /TP /nologo -TP /Z7 /W3 /GR /MDd /Zc:forScope /Zc:wchar_t /wd4675 /EHs /DBOOST_ALL_NO_LIB=1 /DNDEBUG In this way the compiler relies on the default architecture. 1: https://msdn.microsoft.com/en-us/library/7t5yh4fd