Hi
I'm extending python with a cpp code
in my cpp code I have my function that recive a com objetc from python
into args
from here I'm not able to cast such an object into a ccompnt
static PyObject *
connect(PyObject * self, PyObject * args)
{
PyObject * pyApplication;
CComPtr<IUnknown> pUnk;
//try to get active object
if (!PyArg_ParseTuple(args, "O", &pyApplication))
return NULL;
pUnk=(CComPtr<IUnknown> )pyApplication; //<<---- not able to cast
HRESULT hRes = pUnk->QueryInterface(&pApp);
Py_INCREF(Py_None);
return Py_None;
}
I pass the dispached object via win32com as follows
_application = Dispatch('TD_appl.Application',
clsctx=CLSCTX_LOCAL_SERVER | CLSCTX_ACTIVATE_64_BIT_SERVER)
td.connect(_application)
td is my extended module
any hint is really apprecieted
best regards,
Matteo
---
Questa e-mail รจ stata controllata per individuare virus con Avast antivirus.
http://www.avast.com
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32