[pywin32-checkins] pywin32/com/win32com/src/extensions PyIPropertyStorage.cpp,1.11,1.12
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2005-11-29 02:23:15
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24509/com/win32com/src/extensions Modified Files: PyIPropertyStorage.cpp Log Message: Add some code for new VT_ types - but disable it until we know it actually works! Also include the VT_ value when raising an error about unsupported values. Index: PyIPropertyStorage.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIPropertyStorage.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyIPropertyStorage.cpp 31 May 2005 12:36:03 -0000 1.11 --- PyIPropertyStorage.cpp 29 Nov 2005 02:23:07 -0000 1.12 *************** *** 135,140 **** // case VT_DISPATCH: // return PyCom_PyObjectFromIUnknown(pVar->pdispVal, IID_IDispatch, TRUE); default: ! PyErr_SetString(PyExc_TypeError, "Unsupported property type"); return NULL; } --- 135,162 ---- // case VT_DISPATCH: // return PyCom_PyObjectFromIUnknown(pVar->pdispVal, IID_IDispatch, TRUE); + + /* + // Want to get VT_CF and VT_BLOB working with a test case first! + case VT_CF: { // special "clipboard format" + // cbSize is the size of the buffer pointed to + // by pClipData, plus sizeof(ulClipFmt) + // XXX - in that case, shouldn't we pass + // pClipData + sizeof(DWORD) to Py_BuildValue?? + ULONG cb = CBPCLIPDATA(*pVar->pclipdata); + return Py_BuildValue("is#", + pVar->pclipdata->ulClipFmt, + pVar->pclipdata->pClipData, + (int)cb); + } + case VT_BLOB: + // DWORD count of bytes, followed by that many bytes of data. + // The byte count does not include the four bytes for the + // length of the count itself; an empty blob member would + // have a count of zero, followed by zero bytes. + return PyString_FromStringAndSize((const char *)pVar->blob.pBlobData, + pVar->blob.cbSize); + */ default: ! PyErr_Format(PyExc_TypeError, "Unsupported property type 0x%x", pVar->vt); return NULL; } |