[C++-sig] Passing pointer to c++ functions.

2009-02-02 Thread yamini sardana
Hi,

How do we pass a pointer to a c++ function from python.

I have to call the below mentioned function from python

long afSigGenDll_Manual_LevelMax_Get(afSigGenInstance_t sigGenId, double*
pLevelMax);

When i am calling the function with the second argument as
pLevelMax = pointer(c_double())

its giving me an error:
Traceback (most recent call last):
  File "", line 1, in 
TypeError: in method 'afSigGenDll_Manual_LevelMax_Get', argument 2 of type
'double *'

Please le me know what is the correct way to pass pointers as arguments to
c++ functions.

Thanks in advance

Regards,
Yamini
___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Re: [C++-sig] virtual functions and bind size reduction

2009-02-02 Thread Ralf W. Grosse-Kunstleve
> The second module is linked against the first one, so I think that the

> linker should load all shared libraries before any python::boost code
> get executed.

Python needs to execute the init function in the first module. I.e. you have
to have an import from Python.
You could do the Python import from the init of the second module, but
for quick testing, just insert the import somewhere so that it appears
before you expect the dynamic_cast to work.
___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig


Re: [C++-sig] virtual functions and bind size reduction

2009-02-02 Thread Hugo Lima
On Fri, Jan 30, 2009 at 11:13 PM, Ralf W. Grosse-Kunstleve
 wrote:
>> This apparently works fine when running in same module but if I create a 
>> class
>
>> derived from Base in another module (another library), this stop
>> working because the dynamic_cast fails.
>
> Simple idea: is the other module imported before the dynamic_cast is executed?
> That's probably important.
> (Not sure that's it; I hardly ever work with virtual functions.)

The second module is linked against the first one, so I think that the
linker should load all shared libraries before any python::boost code
get executed.

> Ralf
> ___
> Cplusplus-sig mailing list
> Cplusplus-sig@python.org
> http://mail.python.org/mailman/listinfo/cplusplus-sig
>
___
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig