Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12274/com/win32comext/shell/src
Modified Files:
PyIExtractIcon.h PyIExtractIcon.cpp
Log Message:
IExtractIcon explicitly uses the 'A' version to work with Unicode builds
Index: PyIExtractIcon.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIExtractIcon.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PyIExtractIcon.h 7 Oct 2003 02:32:11 -0000 1.2
--- PyIExtractIcon.h 3 Dec 2008 09:59:56 -0000 1.3
***************
*** 9,13 ****
public:
MAKE_PYCOM_CTOR(PyIExtractIcon);
! static IExtractIcon *GetI(PyObject *self);
static PyComTypeObject type;
--- 9,13 ----
public:
MAKE_PYCOM_CTOR(PyIExtractIcon);
! static IExtractIconA *GetI(PyObject *self);
static PyComTypeObject type;
***************
*** 24,28 ****
// Gateway Declaration
! class PyGExtractIcon : public PyGatewayBase, public IExtractIcon
{
protected:
--- 24,28 ----
// Gateway Declaration
! class PyGExtractIcon : public PyGatewayBase, public IExtractIconA
{
protected:
***************
*** 32,38 ****
! // IExtractIcon
STDMETHOD(Extract)(
! LPCTSTR pszFile,
UINT nIconIndex,
HICON * phiconLarge,
--- 32,38 ----
! // IExtractIconA
STDMETHOD(Extract)(
! LPCSTR pszFile,
UINT nIconIndex,
HICON * phiconLarge,
***************
*** 42,46 ****
STDMETHOD(GetIconLocation)(
UINT uFlags,
! LPTSTR szIconFile,
UINT cchMax,
LPINT piIndex,
--- 42,46 ----
STDMETHOD(GetIconLocation)(
UINT uFlags,
! LPSTR szIconFile,
UINT cchMax,
LPINT piIndex,
Index: PyIExtractIcon.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIExtractIcon.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** PyIExtractIcon.cpp 26 Jul 2008 02:31:48 -0000 1.5
--- PyIExtractIcon.cpp 3 Dec 2008 09:59:56 -0000 1.6
***************
*** 18,24 ****
}
! /* static */ IExtractIcon *PyIExtractIcon::GetI(PyObject *self)
{
! return (IExtractIcon *)PyIUnknown::GetI(self);
}
--- 18,24 ----
}
! /* static */ IExtractIconA *PyIExtractIcon::GetI(PyObject *self)
{
! return (IExtractIconA *)PyIUnknown::GetI(self);
}
***************
*** 26,30 ****
PyObject *PyIExtractIcon::Extract(PyObject *self, PyObject *args)
{
! IExtractIcon *pIEI = GetI(self);
if ( pIEI == NULL )
return NULL;
--- 26,30 ----
PyObject *PyIExtractIcon::Extract(PyObject *self, PyObject *args)
{
! IExtractIconA *pIEI = GetI(self);
if ( pIEI == NULL )
return NULL;
***************
*** 35,39 ****
HICON hiconSmall;
PyObject *obpszFile;
! TCHAR *pszFile;
UINT nIconIndex;
UINT nIconSize;
--- 35,39 ----
HICON hiconSmall;
PyObject *obpszFile;
! char *pszFile;
UINT nIconIndex;
UINT nIconSize;
***************
*** 41,50 ****
return NULL;
BOOL bPythonIsHappy = TRUE;
! if (!PyWinObject_AsTCHAR(obpszFile, &pszFile)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIEI->Extract( pszFile, nIconIndex, &hiconLarge, &hiconSmall, nIconSize );
! PyWinObject_FreeTCHAR(pszFile);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
--- 41,50 ----
return NULL;
BOOL bPythonIsHappy = TRUE;
! if (!PyWinObject_AsString(obpszFile, &pszFile)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIEI->Extract( pszFile, nIconIndex, &hiconLarge, &hiconSmall, nIconSize );
! PyWinObject_FreeString(pszFile);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
***************
*** 62,66 ****
PyObject *PyIExtractIcon::GetIconLocation(PyObject *self, PyObject *args)
{
! IExtractIcon *pIEI = GetI(self);
if ( pIEI == NULL )
return NULL;
--- 62,66 ----
PyObject *PyIExtractIcon::GetIconLocation(PyObject *self, PyObject *args)
{
! IExtractIconA *pIEI = GetI(self);
if ( pIEI == NULL )
return NULL;
***************
*** 71,75 ****
if ( !PyArg_ParseTuple(args, "i|i:GetIconLocation", &uFlags, &cchMax))
return NULL;
! TCHAR *buf = (TCHAR *)malloc(cchMax * sizeof(TCHAR));
if (!buf)
return PyErr_NoMemory();
--- 71,75 ----
if ( !PyArg_ParseTuple(args, "i|i:GetIconLocation", &uFlags, &cchMax))
return NULL;
! char *buf = (char *)malloc(cchMax * sizeof(char));
if (!buf)
return PyErr_NoMemory();
***************
*** 84,88 ****
return PyCom_BuildPyException(hr, pIEI, IID_IExtractIcon );
}
! PyObject *retStr = PyWinObject_FromTCHAR(buf);
free(buf);
return Py_BuildValue("iNii", hr, retStr, iIndex, flags);
--- 84,88 ----
return PyCom_BuildPyException(hr, pIEI, IID_IExtractIcon );
}
! PyObject *retStr = PyString_FromString(buf);
free(buf);
return Py_BuildValue("iNii", hr, retStr, iIndex, flags);
***************
*** 106,110 ****
// Gateway Implementation
STDMETHODIMP PyGExtractIcon::Extract(
! /* [unique][in] */ LPCTSTR pszFile,
/* [unique][in] */ UINT nIconIndex,
/* [out] */ HICON * phiconLarge,
--- 106,110 ----
// Gateway Implementation
STDMETHODIMP PyGExtractIcon::Extract(
! /* [unique][in] */ LPCSTR pszFile,
/* [unique][in] */ UINT nIconIndex,
/* [out] */ HICON * phiconLarge,
***************
*** 114,118 ****
PY_GATEWAY_METHOD;
PyObject *obpszFile;
! obpszFile = PyString_FromString((LPTSTR)pszFile);
PyObject *result;
HRESULT hr=InvokeViaPolicy("Extract", &result, "Oii", obpszFile, nIconIndex, nIconSize);
--- 114,118 ----
PY_GATEWAY_METHOD;
PyObject *obpszFile;
! obpszFile = PyString_FromString(pszFile);
PyObject *result;
HRESULT hr=InvokeViaPolicy("Extract", &result, "Oii", obpszFile, nIconIndex, nIconSize);
***************
*** 137,141 ****
STDMETHODIMP PyGExtractIcon::GetIconLocation(
/* [unique][in] */ UINT uFlags,
! /* [unique][out] */ LPTSTR szIconFile,
/* [unique][in] */ UINT cchMax,
/* [unique][out] */ LPINT piIndex,
--- 137,141 ----
STDMETHODIMP PyGExtractIcon::GetIconLocation(
/* [unique][in] */ UINT uFlags,
! /* [unique][out] */ LPSTR szIconFile,
/* [unique][in] */ UINT cchMax,
/* [unique][out] */ LPINT piIndex,
|