MCPcopy Create free account
hub / github.com/mhammond/pywin32 / pythoncom_CreateURLMonikerEx

Function pythoncom_CreateURLMonikerEx

com/win32com/src/PythonCOM.cpp:917–947  ·  view source on GitHub ↗

@pymethod |pythoncom|CreateURLMonikerEx|Create a URL moniker from a full url or partial url and base moniker @pyseeapi CreateURLMonikerEx

Source from the content-addressed store, hash-verified

915// @pymethod <o PyIMoniker>|pythoncom|CreateURLMonikerEx|Create a URL moniker from a full url or partial url and base moniker
916// @pyseeapi CreateURLMonikerEx
917static PyObject *pythoncom_CreateURLMonikerEx(PyObject *self, PyObject *args)
918{
919 WCHAR *url = NULL;
920 PyObject *obbase, *oburl, *ret = NULL;
921 IMoniker *base_moniker = NULL, *output_moniker = NULL;
922 HRESULT hr;
923 DWORD flags = URL_MK_UNIFORM;
924 CHECK_PFN(CreateURLMonikerEx);
925
926 if (!PyArg_ParseTuple(args, "OO|k:CreateURLMonikerEx",
927 &obbase, // @pyparm <o PyIMoniker>|Context||An IMoniker interface to be used as a base with a partial URL, can be None
928 &oburl, // @pyparm <o PyUNICODE>|URL||Full or partial url for which to create a moniker
929 &flags)) // @pyparm int|Flags|URL_MK_UNIFORM|URL_MK_UNIFORM or URL_MK_LEGACY
930 return NULL;
931
932 if (!PyWinObject_AsWCHAR(oburl, &url, FALSE))
933 return NULL;
934 if (PyCom_InterfaceFromPyObject(obbase, IID_IMoniker, (LPVOID*)&base_moniker, TRUE)){
935 PY_INTERFACE_PRECALL;
936 hr = (*pfnCreateURLMonikerEx)(base_moniker, url, &output_moniker, flags);
937 if (base_moniker)
938 base_moniker->Release();
939 PY_INTERFACE_POSTCALL;
940 if (FAILED(hr))
941 PyCom_BuildPyException(hr);
942 else
943 ret=PyCom_PyObjectFromIUnknown(output_moniker, IID_IMoniker, FALSE);
944 }
945 PyWinObject_FreeWCHAR(url);
946 return ret;
947}
948
949// @pymethod <o PyIID>|pythoncom|GetClassFile|Supplies the CLSID associated with the given filename.
950static PyObject *pythoncom_GetClassFile(PyObject *self, PyObject *args)

Callers

nothing calls this directly

Calls 7

FAILEDFunction · 0.85
PyCom_BuildPyExceptionFunction · 0.85
PyWinObject_AsWCHARFunction · 0.50
PyWinObject_FreeWCHARFunction · 0.50
ReleaseMethod · 0.45

Tested by

no test coverage detected