help - obtaining the type of the object usingtp_name

M

Mrinalini Kulkarni

Hello,

I have embedded python into a vc++ app. I need to obtain type of the
variable defined in the python script, in my c++ code.

PyObject *pMyObject; -> assume points to a variable defined in the
python script

Now I want to do something like this

const char * typeName;

typeName = pMyObject->ob_type->tp_name

Is this possible ? I tried doing this but it crashes.

What is the alternative way for getting the name of the type from
python. Is there a function available for this purpose such that I can
obtain the address of that function using GetProcAddress and then use it
for determining the type. (I am required to link to python dynamically)

thanks,
MK
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top