[pywin32-checkins] pywin32/com/win32com/src PythonCOM.cpp, 1.57, 1.58
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Roger U. <ru...@us...> - 2009-02-02 19:30:41
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27598 Modified Files: PythonCOM.cpp Log Message: Add CreateURLMonikerEx Index: PythonCOM.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PythonCOM.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** PythonCOM.cpp 8 Jan 2009 22:35:50 -0000 1.57 --- PythonCOM.cpp 2 Feb 2009 19:30:31 -0000 1.58 *************** *** 920,923 **** --- 920,955 ---- } + // @pymethod <o PyIMoniker>|pythoncom|CreateURLMonikerEx|Create a URL moniker from a full url or partial url and base moniker + // @pyseeapi CreateURLMonikerEx + static PyObject *pythoncom_CreateURLMonikerEx(PyObject *self, PyObject *args) + { + WCHAR *url = NULL; + PyObject *obbase, *oburl, *ret = NULL; + IMoniker *base_moniker = NULL, *output_moniker = NULL; + HRESULT hr; + DWORD flags = URL_MK_UNIFORM; + if (!PyArg_ParseTuple(args, "OO|k:CreateURLMonikerEx", + &obbase, // @pyparm <o PyIMoniker>|Context||An IMoniker interface to be used as a base with a partial URL, can be None + &oburl, // @pyparm <o PyUNICODE>|URL||Full or partial url for which to create a moniker + &flags)) // @pyparm int|Flags|URL_MK_UNIFORM|URL_MK_UNIFORM or URL_MK_LEGACY + return NULL; + + if (!PyWinObject_AsWCHAR(oburl, &url, FALSE)) + return NULL; + if (PyCom_InterfaceFromPyObject(obbase, IID_IMoniker, (LPVOID*)&base_moniker, TRUE)){ + PY_INTERFACE_PRECALL; + hr = CreateURLMonikerEx(base_moniker, url, &output_moniker, flags); + if (base_moniker) + base_moniker->Release(); + PY_INTERFACE_POSTCALL; + if (FAILED(hr)) + PyCom_BuildPyException(hr); + else + ret=PyCom_PyObjectFromIUnknown(output_moniker, IID_IMoniker, FALSE); + } + PyWinObject_FreeWCHAR(url); + return ret; + } + // @pymethod <o PyIID>|pythoncom|GetClassFile|Supplies the CLSID associated with the given filename. static PyObject *pythoncom_GetClassFile(PyObject *self, PyObject *args) *************** *** 1873,1876 **** --- 1905,1911 ---- { "CreateItemMoniker", pythoncom_CreateItemMoniker, 1 }, // @pymeth CreateItemMoniker|Creates an item moniker that identifies an object within a containing object (typically a compound document). { "CreatePointerMoniker", pythoncom_CreatePointerMoniker, 1 }, // @pymeth CreatePointerMoniker|Creates a pointer moniker based on a pointer to an object. + + { "CreateURLMonikerEx", pythoncom_CreateURLMonikerEx, 1 }, // @pymeth CreateURLMoniker|Create a URL moniker from a full url or partial url and base moniker + { "CreateTypeLib", pythoncom_CreateTypeLib, 1}, // @pymeth CreateTypeLib|Provides access to a new object instance that supports the ICreateTypeLib interface. { "CreateTypeLib2", pythoncom_CreateTypeLib2, 1}, // @pymeth CreateTypeLib2|Provides access to a new object instance that supports the ICreateTypeLib2 interface. *************** *** 2344,2347 **** --- 2379,2386 ---- ADD_CONSTANT(MSHLFLAGS_NOPING); + // Flags for CreateUrlMoniker + ADD_CONSTANT(URL_MK_UNIFORM); + ADD_CONSTANT(URL_MK_LEGACY); + #ifndef NO_PYCOM_IDISPATCHEX ADD_CONSTANT(fdexNameCaseSensitive); // Request that the name lookup be done in a case-sensitive manner. May be ignored by object that does not support case-sensitive lookup. |