@pymethod |pythoncom|new|Create a new instance of an OLE automation server.
| 561 | |
| 562 | // @pymethod <o PyIDispatch>|pythoncom|new|Create a new instance of an OLE automation server. |
| 563 | static PyObject *pythoncom_new(PyObject *self, PyObject *args) |
| 564 | { |
| 565 | PyErr_Clear(); |
| 566 | PyObject *progid; |
| 567 | // @pyparm CLSID|cls||An identifier for the program. Usually "program.item" |
| 568 | if (!PyArg_ParseTuple(args, "O", &progid)) |
| 569 | return NULL; |
| 570 | |
| 571 | // @comm This is just a wrapper for the CoCreateInstance method. |
| 572 | // Specifically, this call is identical to: |
| 573 | // <nl>pythoncom.CoCreateInstance(cls, None, pythoncom.CLSCTX_SERVER, pythoncom.IID_IDispatch) |
| 574 | int clsctx = PyCom_HasDCom() ? CLSCTX_SERVER : CLSCTX_INPROC_SERVER| CLSCTX_LOCAL_SERVER; |
| 575 | PyObject *obIID = PyWinObject_FromIID(IID_IDispatch); |
| 576 | PyObject *newArgs = Py_BuildValue("OOiO", progid, Py_None, clsctx, obIID); |
| 577 | Py_DECREF(obIID); |
| 578 | PyObject *rc = pythoncom_CoCreateInstance(self, newArgs); |
| 579 | Py_DECREF(newArgs); |
| 580 | return rc; |
| 581 | } |
| 582 | |
| 583 | #ifndef MS_WINCE |
| 584 | // @pymethod <o PyIID>|pythoncom|CreateGuid|Creates a new, unique GUIID. |
nothing calls this directly
no test coverage detected