pywin32-checkins Mailing List for Python for Windows Extensions (Page 154)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
| 2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
| 2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
| 2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
| 2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
| 2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
| 2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
| 2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
| 2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
| 2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
| 2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
|
From: <mha...@us...> - 2003-10-08 04:32:42
|
Update of /cvsroot/pywin32/pywin32/com
In directory sc8-pr-cvs1:/tmp/cvs-serv14392
Modified Files:
Tag: Python23
win32com.dsp
Log Message:
Add new IDataFormat related files.
Index: win32com.dsp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com.dsp,v
retrieving revision 1.22
retrieving revision 1.22.2.1
diff -C2 -d -r1.22 -r1.22.2.1
*** win32com.dsp 16 Jan 2003 23:53:12 -0000 1.22
--- win32com.dsp 8 Oct 2003 04:32:38 -0000 1.22.2.1
***************
*** 132,154 ****
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
LINK32=link.exe
# ADD BASE LINK32 ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib /nologo /dll /pdb:"Build\System\pythoncom15.pdb" /debug /machine:MIPS /def:".\win32com\src\PythonCOM.def" /out:"Build\System\pythoncom15.dll" /implib:"Build\pythoncom.lib"
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
# ADD LINK32 ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib /nologo /dll /pdb:none /machine:MIPS /nodefaultlib:"$(CENoDefaultLib)" /def:".\win32com\src\PythonCOM.def" /out:"Build\ce\mips\pythoncom15.dll" /implib:"Build\ce\mips\pythoncom.lib" /subsystem:$(CESubsystem)
- BSC32=bscmake.exe
- # ADD BASE BSC32 /nologo
- # ADD BSC32 /nologo
- MTL=midl.exe
- # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
- # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
- RSC=rc.exe
- # ADD BASE RSC /l 0x409 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
- # ADD RSC /l 0x409 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
- CPP=clmips.exe
- # ADD BASE CPP /nologo /ML /W3 /Zi /O2 /I "win32com\src\include" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_WINDLL" /D "_MBCS" /D "BUILD_PYTHONCOM" /D "STRICT" /Yu"stdafx.h" /FD /c
- # ADD CPP /nologo /M$(CECrtMT) /W3 /O1 /I "win32com\src\include" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_WINDLL" /D "BUILD_PYTHONCOM" /D "STRICT" /Yu"stdafx.h" /FD /c
- PFILE=pfile.exe
- # ADD BASE PFILE COPY
- # ADD PFILE COPY
!ELSEIF "$(CFG)" == "win32com - Win32 (WCE SH3) Release"
--- 132,154 ----
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
+ PFILE=pfile.exe
+ # ADD BASE PFILE COPY
+ # ADD PFILE COPY
+ CPP=clmips.exe
+ # ADD BASE CPP /nologo /ML /W3 /Zi /O2 /I "win32com\src\include" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_WINDLL" /D "_MBCS" /D "BUILD_PYTHONCOM" /D "STRICT" /Yu"stdafx.h" /FD /c
+ # ADD CPP /nologo /M$(CECrtMT) /W3 /O1 /I "win32com\src\include" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_WINDLL" /D "BUILD_PYTHONCOM" /D "STRICT" /Yu"stdafx.h" /FD /c
+ RSC=rc.exe
+ # ADD BASE RSC /l 0x409 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
+ # ADD RSC /l 0x409 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
+ MTL=midl.exe
+ # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
+ # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
+ BSC32=bscmake.exe
+ # ADD BASE BSC32 /nologo
+ # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib /nologo /dll /pdb:"Build\System\pythoncom15.pdb" /debug /machine:MIPS /def:".\win32com\src\PythonCOM.def" /out:"Build\System\pythoncom15.dll" /implib:"Build\pythoncom.lib"
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
# ADD LINK32 ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib winsock.lib /nologo /dll /pdb:none /machine:MIPS /nodefaultlib:"$(CENoDefaultLib)" /def:".\win32com\src\PythonCOM.def" /out:"Build\ce\mips\pythoncom15.dll" /implib:"Build\ce\mips\pythoncom.lib" /subsystem:$(CESubsystem)
!ELSEIF "$(CFG)" == "win32com - Win32 (WCE SH3) Release"
***************
*** 166,188 ****
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
LINK32=link.exe
# ADD BASE LINK32 ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib /nologo /dll /pdb:"Build\System\pythoncom15.pdb" /debug /machine:SH3 /def:".\win32com\src\PythonCOM.def" /out:"Build\System\pythoncom15.dll" /implib:"Build\pythoncom.lib"
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
# ADD LINK32 ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib /nologo /dll /pdb:none /machine:SH3 /nodefaultlib:"$(CENoDefaultLib)" /def:".\win32com\src\PythonCOM.def" /out:"Build\ce\sh\pythoncom15.dll" /implib:"Build\ce\sh\pythoncom.lib" /subsystem:$(CESubsystem)
- BSC32=bscmake.exe
- # ADD BASE BSC32 /nologo
- # ADD BSC32 /nologo
- MTL=midl.exe
- # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
- # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
- RSC=rc.exe
- # ADD BASE RSC /l 0x409 /r /d "SHx" /d "SH3" /d "_SH3_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
- # ADD RSC /l 0x409 /r /d "SHx" /d "SH3" /d "_SH3_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
- CPP=shcl.exe
- # ADD BASE CPP /nologo /ML /W3 /Zi /O2 /I "win32com\src\include" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_WINDLL" /D "_MBCS" /D "BUILD_PYTHONCOM" /D "STRICT" /Yu"stdafx.h" /FD /c
- # ADD CPP /nologo /M$(CECrtMT) /W3 /O1 /I "win32com\src\include" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_WINDLL" /D "_MBCS" /D "BUILD_PYTHONCOM" /D "STRICT" /Yu"stdafx.h" /FD /c
- PFILE=pfile.exe
- # ADD BASE PFILE COPY
- # ADD PFILE COPY
!ELSEIF "$(CFG)" == "win32com - Win32 (WCE x86em) Debug"
--- 166,188 ----
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
+ PFILE=pfile.exe
+ # ADD BASE PFILE COPY
+ # ADD PFILE COPY
+ CPP=shcl.exe
+ # ADD BASE CPP /nologo /ML /W3 /Zi /O2 /I "win32com\src\include" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_WINDLL" /D "_MBCS" /D "BUILD_PYTHONCOM" /D "STRICT" /Yu"stdafx.h" /FD /c
+ # ADD CPP /nologo /M$(CECrtMT) /W3 /O1 /I "win32com\src\include" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "NDEBUG" /D "SHx" /D "SH3" /D "_SH3_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_WINDLL" /D "_MBCS" /D "BUILD_PYTHONCOM" /D "STRICT" /Yu"stdafx.h" /FD /c
+ RSC=rc.exe
+ # ADD BASE RSC /l 0x409 /r /d "SHx" /d "SH3" /d "_SH3_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
+ # ADD RSC /l 0x409 /r /d "SHx" /d "SH3" /d "_SH3_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "NDEBUG"
+ MTL=midl.exe
+ # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
+ # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
+ BSC32=bscmake.exe
+ # ADD BASE BSC32 /nologo
+ # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib /nologo /dll /pdb:"Build\System\pythoncom15.pdb" /debug /machine:SH3 /def:".\win32com\src\PythonCOM.def" /out:"Build\System\pythoncom15.dll" /implib:"Build\pythoncom.lib"
# SUBTRACT BASE LINK32 /pdb:none /nodefaultlib
# ADD LINK32 ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib /nologo /dll /pdb:none /machine:SH3 /nodefaultlib:"$(CENoDefaultLib)" /def:".\win32com\src\PythonCOM.def" /out:"Build\ce\sh\pythoncom15.dll" /implib:"Build\ce\sh\pythoncom.lib" /subsystem:$(CESubsystem)
!ELSEIF "$(CFG)" == "win32com - Win32 (WCE x86em) Debug"
***************
*** 200,203 ****
--- 200,218 ----
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
+ EMPFILE=empfile.exe
+ # ADD BASE EMPFILE COPY
+ # ADD EMPFILE COPY
+ CPP=cl.exe
+ # ADD BASE CPP /nologo /MLd /W3 /Gm /ZI /Od /I "win32com\src\include" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "STRICT" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "_DEBUG" /D "x86" /D "i486" /D "_x86_" /D "_WINDLL" /D "_MBCS" /D "BUILD_PYTHONCOM" /Yu"stdafx.h" /FD /c
+ # ADD CPP /nologo /MTd /W3 /Gm /Zi /Od /I "win32com\src\include" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "STRICT" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "_DEBUG" /D "x86" /D "i486" /D "_x86_" /D "_WINDLL" /D "_MBCS" /D "BUILD_PYTHONCOM" /YX"stdafx.h" /FD /c
+ RSC=rc.exe
+ # ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "WIN32" /d "STRICT" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "_WIN32_WCE_EMULATION" /d "INTERNATIONAL" /d "USA" /d "INTLMSG_CODEPAGE" /d "_DEBUG" /d "x86" /d "i486" /d "_x86_"
+ # ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "WIN32" /d "STRICT" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "_WIN32_WCE_EMULATION" /d "INTERNATIONAL" /d "USA" /d "INTLMSG_CODEPAGE" /d "_DEBUG" /d "x86" /d "i486" /d "_x86_"
+ MTL=midl.exe
+ # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
+ # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
+ BSC32=bscmake.exe
+ # ADD BASE BSC32 /nologo
+ # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib /nologo /base:"0x1e2a0000" /subsystem:windows /dll /pdb:"Build\System\pythoncom15_d.pdb" /debug /machine:IX86 /def:".\win32com\src\PythonCOM.def" /out:"Build\System\pythoncom15_d.dll" /implib:"Build\pythoncom_d.lib" /pdbtype:sept
***************
*** 205,223 ****
# ADD LINK32 coredll.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e2a0000" /subsystem:windows /dll /debug /machine:IX86 /nodefaultlib:"$(CENoDefaultLib)" /def:".\win32com\src\PythonCOM.def" /out:"Build\ce\x86em\pythoncom15_d.dll" /implib:"Build\pythoncom_d.lib" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
- BSC32=bscmake.exe
- # ADD BASE BSC32 /nologo
- # ADD BSC32 /nologo
- MTL=midl.exe
- # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
- # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
- RSC=rc.exe
- # ADD BASE RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "WIN32" /d "STRICT" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "_WIN32_WCE_EMULATION" /d "INTERNATIONAL" /d "USA" /d "INTLMSG_CODEPAGE" /d "_DEBUG" /d "x86" /d "i486" /d "_x86_"
- # ADD RSC /l 0x409 /d UNDER_CE=$(CEVersion) /d "UNICODE" /d "_UNICODE" /d "WIN32" /d "STRICT" /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "_WIN32_WCE_EMULATION" /d "INTERNATIONAL" /d "USA" /d "INTLMSG_CODEPAGE" /d "_DEBUG" /d "x86" /d "i486" /d "_x86_"
- CPP=cl.exe
- # ADD BASE CPP /nologo /MLd /W3 /Gm /ZI /Od /I "win32com\src\include" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "STRICT" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "_DEBUG" /D "x86" /D "i486" /D "_x86_" /D "_WINDLL" /D "_MBCS" /D "BUILD_PYTHONCOM" /Yu"stdafx.h" /FD /c
- # ADD CPP /nologo /MTd /W3 /Gm /Zi /Od /I "win32com\src\include" /D UNDER_CE=$(CEVersion) /D "UNICODE" /D "_UNICODE" /D "WIN32" /D "STRICT" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "_WIN32_WCE_EMULATION" /D "INTERNATIONAL" /D "USA" /D "INTLMSG_CODEPAGE" /D "_DEBUG" /D "x86" /D "i486" /D "_x86_" /D "_WINDLL" /D "_MBCS" /D "BUILD_PYTHONCOM" /YX"stdafx.h" /FD /c
- EMPFILE=empfile.exe
- # ADD BASE EMPFILE COPY
- # ADD EMPFILE COPY
!ELSEIF "$(CFG)" == "win32com - Win32 (WCE MIPS) Debug"
--- 220,223 ----
***************
*** 235,238 ****
--- 235,253 ----
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
+ PFILE=pfile.exe
+ # ADD BASE PFILE COPY
+ # ADD PFILE COPY
+ CPP=clmips.exe
+ # ADD BASE CPP /nologo /MLd /W3 /Zi /Od /I "win32com\src\include" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /Yu"stdafx.h" /FD /c
+ # ADD CPP /nologo /M$(CECrtMT) /W3 /Zi /Od /I "win32com\src\include" /D "BUILD_PYTHONCOM" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /Yu"stdafx.h" /FD /c
+ RSC=rc.exe
+ # ADD BASE RSC /l 0x409 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
+ # ADD RSC /l 0x409 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
+ MTL=midl.exe
+ # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
+ # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
+ BSC32=bscmake.exe
+ # ADD BASE BSC32 /nologo
+ # ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib /nologo /dll /debug /machine:MIPS /def:".\win32com\src\PythonCOM.def" /out:"Build\ce\x86em\pythoncom15_d.dll" /implib:"Build\pythoncom_d.lib" /pdbtype:sept
***************
*** 240,258 ****
# ADD LINK32 corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib coredll.lib /nologo /dll /debug /machine:MIPS /nodefaultlib:"$(CENoDefaultLib)" /def:".\win32com\src\PythonCOM.def" /out:"Build\ce\mips\pythoncom15_d.dll" /implib:"Build\ce\mips\pythoncom_d.lib" /pdbtype:sept /subsystem:$(CESubsystem)
# SUBTRACT LINK32 /pdb:none
- BSC32=bscmake.exe
- # ADD BASE BSC32 /nologo
- # ADD BSC32 /nologo
- MTL=midl.exe
- # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
- # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /o /win32 "NUL"
- RSC=rc.exe
- # ADD BASE RSC /l 0x409 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
- # ADD RSC /l 0x409 /r /d "MIPS" /d "_MIPS_" /d UNDER_CE=$(CEVersion) /d _WIN32_WCE=$(CEVersion) /d "$(CEConfigName)" /d "UNICODE" /d "DEBUG"
- CPP=clmips.exe
- # ADD BASE CPP /nologo /MLd /W3 /Zi /Od /I "win32com\src\include" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /Yu"stdafx.h" /FD /c
- # ADD CPP /nologo /M$(CECrtMT) /W3 /Zi /Od /I "win32com\src\include" /D "BUILD_PYTHONCOM" /D _WIN32_WCE=$(CEVersion) /D "$(CEConfigName)" /D "DEBUG" /D "MIPS" /D "_MIPS_" /D UNDER_CE=$(CEVersion) /D "UNICODE" /Yu"stdafx.h" /FD /c
- PFILE=pfile.exe
- # ADD BASE PFILE COPY
- # ADD PFILE COPY
!ENDIF
--- 255,258 ----
***************
*** 4590,4593 ****
--- 4590,4612 ----
# Begin Source File
+ SOURCE=.\win32com\src\extensions\PyIDataObject.cpp
+
+ !IF "$(CFG)" == "win32com - Win32 Release"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 Debug"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 (WCE MIPS) Release"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 (WCE SH3) Release"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 (WCE x86em) Debug"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 (WCE MIPS) Debug"
+
+ !ENDIF
+
+ # End Source File
+ # Begin Source File
+
SOURCE=.\win32com\src\extensions\PyIEnumCATEGORYINFO.cpp
***************
*** 4848,4851 ****
--- 4867,4889 ----
# Begin Source File
+ SOURCE=.\win32com\src\extensions\PyIEnumFORMATETC.cpp
+
+ !IF "$(CFG)" == "win32com - Win32 Release"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 Debug"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 (WCE MIPS) Release"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 (WCE SH3) Release"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 (WCE x86em) Debug"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 (WCE MIPS) Debug"
+
+ !ENDIF
+
+ # End Source File
+ # Begin Source File
+
SOURCE=.\win32com\src\extensions\PyIEnumGUID.cpp
***************
*** 7927,7930 ****
--- 7965,7987 ----
# Begin Source File
+ SOURCE=.\win32com\src\extensions\PySTGMEDIUM.cpp
+
+ !IF "$(CFG)" == "win32com - Win32 Release"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 Debug"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 (WCE MIPS) Release"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 (WCE SH3) Release"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 (WCE x86em) Debug"
+
+ !ELSEIF "$(CFG)" == "win32com - Win32 (WCE MIPS) Debug"
+
+ !ENDIF
+
+ # End Source File
+ # Begin Source File
+
SOURCE=.\win32com\src\extensions\PyTYPEATTR.cpp
***************
*** 8293,8296 ****
--- 8350,8357 ----
# Begin Source File
+ SOURCE=.\win32com\src\include\PyIDataObject.h
+ # End Source File
+ # Begin Source File
+
SOURCE=.\win32com\src\include\PyIEnumConnectionPoints.h
# End Source File
***************
*** 8298,8301 ****
--- 8359,8366 ----
SOURCE=.\win32com\src\include\PyIEnumConnections.h
+ # End Source File
+ # Begin Source File
+
+ SOURCE=.\win32com\src\include\PyIEnumFORMATETC.h
# End Source File
# Begin Source File
|
|
From: <mha...@us...> - 2003-10-08 04:28:46
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions
In directory sc8-pr-cvs1:/tmp/cvs-serv13856/extensions
Added Files:
PyIDataObject.cpp PyIEnumFORMATETC.cpp PySTGMEDIUM.cpp
Log Message:
Add IDataFormat and support for FORMATETC and STGMEDIUM
--- NEW FILE: PyIDataObject.cpp ---
// This file implements the IDataObject Interface and Gateway for Python.
// Generated by makegw.py
#include "stdafx.h"
#include "PythonCOM.h"
#include "PythonCOMServer.h"
#include "PyIDataObject.h"
#include "PyComTypeObjects.h"
BOOL PyObject_AsFORMATETC(PyObject *ob, FORMATETC *petc)
{
PyObject *obtd;
if (!PyArg_ParseTuple(ob, "iOiii",
&petc->cfFormat,
&obtd,
&petc->dwAspect,
&petc->lindex,
&petc->tymed))
return FALSE;
if (obtd!=Py_None) {
PyErr_SetString(PyExc_ValueError, "td must be None");
return FALSE;
}
petc->ptd = NULL;
return TRUE;
}
PyObject *PyObject_FromFORMATETC(FORMATETC *petc)
{
return Py_BuildValue("iziii",
petc->cfFormat,
NULL,
petc->dwAspect,
petc->lindex,
petc->tymed);
}
BOOL PyObject_AsPySTGMEDIUM(PyObject *obmedium, PySTGMEDIUM **pp)
{
if (!PySTGMEDIUM_Check(obmedium)) {
PyErr_Format(PyExc_TypeError, "Object must be a PySTGMEDIUM (not a '%s')", obmedium->ob_type->tp_name);
return FALSE;
}
*pp = (PySTGMEDIUM *)obmedium;
return TRUE;
}
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
// Interface Implementation
PyIDataObject::PyIDataObject(IUnknown *pdisp):
PyIUnknown(pdisp)
{
ob_type = &type;
}
PyIDataObject::~PyIDataObject()
{
}
/* static */ IDataObject *PyIDataObject::GetI(PyObject *self)
{
return (IDataObject *)PyIUnknown::GetI(self);
}
// @pymethod |PyIDataObject|GetData|Description of GetData.
PyObject *PyIDataObject::GetData(PyObject *self, PyObject *args)
{
IDataObject *pIDO = GetI(self);
if ( pIDO == NULL )
return NULL;
FORMATETC formatetcIn;
PyObject *obpformatetcIn;
// @pyparm <o PyFORMATETC>|pformatetcIn||Description for pformatetcIn
if ( !PyArg_ParseTuple(args, "O:GetData", &obpformatetcIn) )
return NULL;
PySTGMEDIUM *pymedium = PyObject_FromSTGMEDIUM();
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsFORMATETC( obpformatetcIn, &formatetcIn )) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIDO->GetData( &formatetcIn, &pymedium->medium);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) ) {
Py_DECREF(pymedium);
return PyCom_BuildPyException(hr, pIDO, IID_IDataObject );
}
return pymedium;
}
// @pymethod |PyIDataObject|GetDataHere|Description of GetDataHere.
PyObject *PyIDataObject::GetDataHere(PyObject *self, PyObject *args)
{
IDataObject *pIDO = GetI(self);
if ( pIDO == NULL )
return NULL;
FORMATETC formatetc;
PyObject *obpformatetc;
// @pyparm <o PyFORMATETC>|pformatetcIn||Description for pformatetcIn
if ( !PyArg_ParseTuple(args, "O:GetDataHere", &obpformatetc) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsFORMATETC( obpformatetc, &formatetc )) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
PySTGMEDIUM *pymedium = PyObject_FromSTGMEDIUM();
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIDO->GetDataHere( &formatetc, &pymedium->medium);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) ) {
Py_DECREF(pymedium);
return PyCom_BuildPyException(hr, pIDO, IID_IDataObject );
}
return pymedium;
}
// @pymethod |PyIDataObject|QueryGetData|Description of QueryGetData.
PyObject *PyIDataObject::QueryGetData(PyObject *self, PyObject *args)
{
IDataObject *pIDO = GetI(self);
if ( pIDO == NULL )
return NULL;
FORMATETC formatetc;
PyObject *obpformatetc;
// @pyparm <o PyFORMATETC>|pformatetc||Description for pformatetc
if ( !PyArg_ParseTuple(args, "O:QueryGetData", &obpformatetc) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsFORMATETC( obpformatetc, &formatetc )) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIDO->QueryGetData( &formatetc );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIDO, IID_IDataObject );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIDataObject|GetCanonicalFormatEtc|Description of GetCanonicalFormatEtc.
PyObject *PyIDataObject::GetCanonicalFormatEtc(PyObject *self, PyObject *args)
{
IDataObject *pIDO = GetI(self);
if ( pIDO == NULL )
return NULL;
FORMATETC formatectIn;
PyObject *obpformatectIn;
// @pyparm <o PyFORMATETC *>|pformatectIn||Description for pformatectIn
if ( !PyArg_ParseTuple(args, "O:GetCanonicalFormatEtc", &obpformatectIn) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsFORMATETC( obpformatectIn, &formatectIn )) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
FORMATETC formatetcOut;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIDO->GetCanonicalFormatEtc( &formatectIn, &formatetcOut );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIDO, IID_IDataObject );
return PyObject_FromFORMATETC(&formatetcOut);
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIDataObject|SetData|Description of SetData.
PyObject *PyIDataObject::SetData(PyObject *self, PyObject *args)
{
IDataObject *pIDO = GetI(self);
if ( pIDO == NULL )
return NULL;
FORMATETC formatetc;
PyObject *obpformatetc;
// @pyparm <o PyFORMATETC>|pformatetc||Description for pformatetc
PyObject *obmedium;
PySTGMEDIUM *pymedium;
// @pyparm <o PySTGMEDIUM *>|pmedium||Description for pmedium
// @pyparm int|fRelease||Description for fRelease
BOOL fRelease;
if ( !PyArg_ParseTuple(args, "OOi:SetData", &obpformatetc, &obmedium, &fRelease) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsFORMATETC( obpformatetc, &formatetc )) bPythonIsHappy = FALSE;
if (bPythonIsHappy && !PyObject_AsPySTGMEDIUM( obmedium, &pymedium )) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIDO->SetData( &formatetc, &pymedium->medium, fRelease );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIDO, IID_IDataObject );
if (fRelease)
pymedium->DropOwnership();
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIDataObject|EnumFormatEtc|Description of EnumFormatEtc.
PyObject *PyIDataObject::EnumFormatEtc(PyObject *self, PyObject *args)
{
IDataObject *pIDO = GetI(self);
if ( pIDO == NULL )
return NULL;
// @pyparm int|dwDirection|DATADIR_GET|Description for dwDirection
DWORD dwDirection = DATADIR_GET;
IEnumFORMATETC * ppenumFormatEtc;
if ( !PyArg_ParseTuple(args, "|l:EnumFormatEtc", &dwDirection) )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIDO->EnumFormatEtc( dwDirection, &ppenumFormatEtc );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIDO, IID_IDataObject );
return PyCom_PyObjectFromIUnknown(ppenumFormatEtc, IID_IEnumFORMATETC, FALSE);
}
// @pymethod |PyIDataObject|DAdvise|Description of DAdvise.
PyObject *PyIDataObject::DAdvise(PyObject *self, PyObject *args)
{
IDataObject *pIDO = GetI(self);
if ( pIDO == NULL )
return NULL;
FORMATETC formatetc;
PyObject *obpformatetc;
// @pyparm <o PyFORMATETC>|pformatetc||Description for pformatetc
// @pyparm int|advf||Description for advf
// @pyparm <o PyIAdviseSink *>|pAdvSink||Description for pAdvSink
PyObject *obpAdvSink;
DWORD advf;
IAdviseSink *pAdvSink;
if ( !PyArg_ParseTuple(args, "OlO:DAdvise", &obpformatetc, &advf, &obpAdvSink) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyObject_AsFORMATETC( obpformatetc, &formatetc )) bPythonIsHappy = FALSE;
if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obpAdvSink, IID_IAdviseSink, (void **)&pAdvSink, TRUE /* bNoneOK */))
bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
DWORD dwConnection;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIDO->DAdvise( &formatetc, advf, pAdvSink, &dwConnection );
PY_INTERFACE_POSTCALL;
if (pAdvSink) pAdvSink->Release();
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIDO, IID_IDataObject );
return PyInt_FromLong(dwConnection);
}
// @pymethod |PyIDataObject|DUnadvise|Description of DUnadvise.
PyObject *PyIDataObject::DUnadvise(PyObject *self, PyObject *args)
{
IDataObject *pIDO = GetI(self);
if ( pIDO == NULL )
return NULL;
// @pyparm int|dwConnection||Description for dwConnection
DWORD dwConnection;
if ( !PyArg_ParseTuple(args, "l:DUnadvise", &dwConnection) )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIDO->DUnadvise( dwConnection );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIDO, IID_IDataObject );
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIDataObject|EnumDAdvise|Description of EnumDAdvise.
PyObject *PyIDataObject::EnumDAdvise(PyObject *self, PyObject *args)
{
IDataObject *pIDO = GetI(self);
if ( pIDO == NULL )
return NULL;
IEnumSTATDATA *ppenumAdvise;
if ( !PyArg_ParseTuple(args, ":EnumDAdvise") )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pIDO->EnumDAdvise( &ppenumAdvise );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pIDO, IID_IDataObject );
return PyCom_PyObjectFromIUnknown(ppenumAdvise, IID_IEnumSTATDATA, FALSE);
}
// @object PyIDataObject|Description of the interface
static struct PyMethodDef PyIDataObject_methods[] =
{
{ "GetData", PyIDataObject::GetData, 1 }, // @pymeth GetData|Description of GetData
{ "GetDataHere", PyIDataObject::GetDataHere, 1 }, // @pymeth GetDataHere|Description of GetDataHere
{ "QueryGetData", PyIDataObject::QueryGetData, 1 }, // @pymeth QueryGetData|Description of QueryGetData
{ "GetCanonicalFormatEtc", PyIDataObject::GetCanonicalFormatEtc, 1 }, // @pymeth GetCanonicalFormatEtc|Description of GetCanonicalFormatEtc
{ "SetData", PyIDataObject::SetData, 1 }, // @pymeth SetData|Description of SetData
{ "EnumFormatEtc", PyIDataObject::EnumFormatEtc, 1 }, // @pymeth EnumFormatEtc|Description of EnumFormatEtc
{ "DAdvise", PyIDataObject::DAdvise, 1 }, // @pymeth DAdvise|Description of DAdvise
{ "DUnadvise", PyIDataObject::DUnadvise, 1 }, // @pymeth DUnadvise|Description of DUnadvise
{ "EnumDAdvise", PyIDataObject::EnumDAdvise, 1 }, // @pymeth EnumDAdvise|Description of EnumDAdvise
{ NULL }
};
PyComTypeObject PyIDataObject::type("PyIDataObject",
&PyIUnknown::type,
sizeof(PyIDataObject),
PyIDataObject_methods,
GET_PYCOM_CTOR(PyIDataObject));
// ---------------------------------------------------
//
// Gateway Implementation
STDMETHODIMP PyGDataObject::GetData(
/* [unique][in] */ FORMATETC * pformatetcIn,
/* [out] */ STGMEDIUM * pmedium)
{
PY_GATEWAY_METHOD;
PyObject *obpformatetcIn = PyObject_FromFORMATETC(pformatetcIn);
if (obpformatetcIn==NULL) return PyCom_HandlePythonFailureToCOM();
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetData", &result, "O", obpformatetcIn);
Py_DECREF(obpformatetcIn);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
if (PySTGMEDIUM_Check(result)) {
PySTGMEDIUM *pym = (PySTGMEDIUM *)result;
memcpy(pmedium, &pym->medium, sizeof(STGMEDIUM));
pym->DropOwnership();
}
hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGDataObject::GetDataHere(
/* [unique][in] */ FORMATETC * pformatetc,
/* [out][in] */ STGMEDIUM * pmedium)
{
PY_GATEWAY_METHOD;
PyObject *obpformatetc = PyObject_FromFORMATETC(pformatetc);
if (obpformatetc==NULL) return PyCom_HandlePythonFailureToCOM();
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetDataHere", &result, "O", obpformatetc);
Py_DECREF(obpformatetc);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
if (PySTGMEDIUM_Check(result)) {
PySTGMEDIUM *pym = (PySTGMEDIUM *)result;
memcpy(pmedium, &pym->medium, sizeof(STGMEDIUM));
pym->DropOwnership();
}
hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGDataObject::QueryGetData(
/* [unique][in] */ FORMATETC * pformatetc)
{
PY_GATEWAY_METHOD;
PyObject *obpformatetc = PyObject_FromFORMATETC(pformatetc);
if (obpformatetc==NULL) return PyCom_HandlePythonFailureToCOM();
HRESULT hr=InvokeViaPolicy("QueryGetData", NULL, "O", obpformatetc);
Py_DECREF(obpformatetc);
return hr;
}
STDMETHODIMP PyGDataObject::GetCanonicalFormatEtc(
/* [unique][in] */ FORMATETC * pformatectIn,
/* [out] */ FORMATETC * pformatetcOut)
{
PY_GATEWAY_METHOD;
PyObject *obpformatectIn = PyObject_FromFORMATETC(pformatectIn);
if (obpformatectIn==NULL) return PyCom_HandlePythonFailureToCOM();
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetCanonicalFormatEtc", &result, "O", obpformatectIn);
Py_DECREF(obpformatectIn);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
PyObject_AsFORMATETC(result, pformatetcOut);
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGDataObject::SetData(
/* [unique][in] */ FORMATETC * pformatetc,
/* [unique][in] */ STGMEDIUM * pmedium,
/* [in] */ BOOL fRelease)
{
PY_GATEWAY_METHOD;
PyObject *obpformatetc = PyObject_FromFORMATETC(pformatetc);
if (obpformatetc==NULL) return PyCom_HandlePythonFailureToCOM();
PySTGMEDIUM *obmedium = PyObject_FromSTGMEDIUM(pmedium);
if (obmedium==NULL) return PyCom_HandlePythonFailureToCOM();
HRESULT hr=InvokeViaPolicy("SetData", NULL, "OOi", obpformatetc, obmedium, fRelease);
if (!fRelease)
obmedium->DropOwnership();
Py_DECREF(obpformatetc);
Py_DECREF(obmedium);
return hr;
}
STDMETHODIMP PyGDataObject::EnumFormatEtc(
/* [in] */ DWORD dwDirection,
/* [out] */ IEnumFORMATETC ** ppenumFormatEtc)
{
PY_GATEWAY_METHOD;
PyObject *result;
HRESULT hr=InvokeViaPolicy("EnumFormatEtc", &result, "l", dwDirection);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
PyObject *obppenumFormatEtc;
if (!PyArg_Parse(result, "O" , &obppenumFormatEtc)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppenumFormatEtc, IID_IEnumFORMATETC, (void **)ppenumFormatEtc, TRUE /* bNoneOK */))
bPythonIsHappy = FALSE;
if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGDataObject::DAdvise(
/* [in] */ FORMATETC * pformatetc,
/* [in] */ DWORD advf,
/* [unique][in] */ IAdviseSink * pAdvSink,
/* [out] */ DWORD * pdwConnection)
{
PY_GATEWAY_METHOD;
PyObject *obpformatetc = PyObject_FromFORMATETC(pformatetc);
if (obpformatetc==NULL) return PyCom_HandlePythonFailureToCOM();
PyObject *obpAdvSink;
obpAdvSink = PyCom_PyObjectFromIUnknown(pAdvSink, IID_IAdviseSink, TRUE);
PyObject *result;
HRESULT hr=InvokeViaPolicy("DAdvise", &result, "OlO", obpformatetc, advf, obpAdvSink);
Py_DECREF(obpformatetc);
Py_XDECREF(obpAdvSink);
if (FAILED(hr)) return hr;
*pdwConnection = PyInt_AsLong(result);
Py_DECREF(result);
return hr;
}
STDMETHODIMP PyGDataObject::DUnadvise(
/* [in] */ DWORD dwConnection)
{
PY_GATEWAY_METHOD;
HRESULT hr=InvokeViaPolicy("DUnadvise", NULL, "l", dwConnection);
return hr;
}
STDMETHODIMP PyGDataObject::EnumDAdvise(
/* [out] */ IEnumSTATDATA ** ppenumAdvise)
{
PY_GATEWAY_METHOD;
PyObject *result;
HRESULT hr=InvokeViaPolicy("EnumDAdvise", &result);
if (FAILED(hr)) return hr;
// Process the Python results, and convert back to the real params
PyObject *obppenumAdvise;
if (!PyArg_Parse(result, "O" , &obppenumAdvise)) return PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(obppenumAdvise, IID_IEnumSTATDATA, (void **)ppenumAdvise, TRUE /* bNoneOK */))
bPythonIsHappy = FALSE;
if (!bPythonIsHappy) hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
Py_DECREF(result);
return hr;
}
--- NEW FILE: PyIEnumFORMATETC.cpp ---
// This file implements the IEnumFORMATETC Interface and Gateway for Python.
// Generated by makegw.py
#include "stdafx.h"
#include "PythonCOM.h"
#include "PythonCOMServer.h"
#include "PyIEnumFORMATETC.h"
extern BOOL PyObject_AsFORMATETC(PyObject *ob, FORMATETC *petc);
extern PyObject *PyObject_FromFORMATETC(FORMATETC *petc);
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
// Interface Implementation
PyIEnumFORMATETC::PyIEnumFORMATETC(IUnknown *pdisp):
PyIUnknown(pdisp)
{
ob_type = &type;
}
PyIEnumFORMATETC::~PyIEnumFORMATETC()
{
}
/* static */ IEnumFORMATETC *PyIEnumFORMATETC::GetI(PyObject *self)
{
return (IEnumFORMATETC *)PyIUnknown::GetI(self);
}
PyObject *
PyIEnumFORMATETC::iter()
{
Py_INCREF(this);
return this;
}
PyObject *
PyIEnumFORMATETC::iternext()
{
ULONG celtFetched = 0;
FORMATETC ret;;
IEnumFORMATETC *peidl = GetI(this);
if ( peidl == NULL )
return NULL;
PY_INTERFACE_PRECALL;
HRESULT hr = peidl->Next(1, &ret, &celtFetched);
PY_INTERFACE_POSTCALL;
if ( HRESULT_CODE(hr) != ERROR_NO_MORE_ITEMS && FAILED(hr) )
return PyCom_BuildPyException(hr,peidl, IID_IEnumFORMATETC);
if (celtFetched==0) {
PyErr_SetNone(PyExc_StopIteration);
return NULL;
}
return PyObject_FromFORMATETC(&ret);
}
// @pymethod object|PyIEnumFORMATETC|Next|Retrieves a specified number of items in the enumeration sequence.
PyObject *PyIEnumFORMATETC::Next(PyObject *self, PyObject *args)
{
long celt = 1;
// @pyparm int|num|1|Number of items to retrieve.
if ( !PyArg_ParseTuple(args, "|l:Next", &celt) )
return NULL;
IEnumFORMATETC *peidl = GetI(self);
if ( peidl == NULL )
return NULL;
FORMATETC *rgVar = new FORMATETC[celt];
if ( rgVar == NULL ) {
PyErr_SetString(PyExc_MemoryError, "allocating result FORMATETCs");
return NULL;
}
memset(rgVar, 0, sizeof(FORMATETC)*celt);
ULONG celtFetched = 0;
PY_INTERFACE_PRECALL;
HRESULT hr = peidl->Next(celt, rgVar, &celtFetched);
PY_INTERFACE_POSTCALL;
if ( HRESULT_CODE(hr) != ERROR_NO_MORE_ITEMS && FAILED(hr) )
{
delete [] rgVar;
return PyCom_BuildPyException(hr,peidl, IID_IEnumFORMATETC);
}
PyObject *result = PyList_New(celtFetched);
int i;
if ( result != NULL )
{
for ( i = celtFetched; i--; )
{
PyObject *ob = PyObject_FromFORMATETC(rgVar+i);
if ( ob == NULL )
{
Py_DECREF(result);
result = NULL;
break;
}
PyList_SET_ITEM(result, i, ob);
}
}
delete [] rgVar;
return result;
}
// @pymethod |PyIEnumFORMATETC|Skip|Skips over the next specified elementes.
PyObject *PyIEnumFORMATETC::Skip(PyObject *self, PyObject *args)
{
long celt;
if ( !PyArg_ParseTuple(args, "l:Skip", &celt) )
return NULL;
IEnumFORMATETC *peidl = GetI(self);
if ( peidl == NULL )
return NULL;
PY_INTERFACE_PRECALL;
HRESULT hr = peidl->Skip(celt);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, peidl, IID_IEnumFORMATETC);
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod |PyIEnumFORMATETC|Reset|Resets the enumeration sequence to the beginning.
PyObject *PyIEnumFORMATETC::Reset(PyObject *self, PyObject *args)
{
if ( !PyArg_ParseTuple(args, ":Reset") )
return NULL;
IEnumFORMATETC *peidl = GetI(self);
if ( peidl == NULL )
return NULL;
PY_INTERFACE_PRECALL;
HRESULT hr = peidl->Reset();
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, peidl, IID_IEnumFORMATETC);
Py_INCREF(Py_None);
return Py_None;
}
// @pymethod <o PyIEnumFORMATETC>|PyIEnumFORMATETC|Clone|Creates another enumerator that contains the same enumeration state as the current one
PyObject *PyIEnumFORMATETC::Clone(PyObject *self, PyObject *args)
{
if ( !PyArg_ParseTuple(args, ":Clone") )
return NULL;
IEnumFORMATETC *peidl = GetI(self);
if ( peidl == NULL )
return NULL;
IEnumFORMATETC *pClone;
PY_INTERFACE_PRECALL;
HRESULT hr = peidl->Clone(&pClone);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, peidl, IID_IEnumFORMATETC);
return PyCom_PyObjectFromIUnknown(pClone, IID_IEnumFORMATETC, FALSE);
}
// @object PyIEnumFORMATETC|A Python interface to IEnumFORMATETC
static struct PyMethodDef PyIEnumFORMATETC_methods[] =
{
{ "Next", PyIEnumFORMATETC::Next, 1 }, // @pymeth Next|Retrieves a specified number of items in the enumeration sequence.
{ "Skip", PyIEnumFORMATETC::Skip, 1 }, // @pymeth Skip|Skips over the next specified elementes.
{ "Reset", PyIEnumFORMATETC::Reset, 1 }, // @pymeth Reset|Resets the enumeration sequence to the beginning.
{ "Clone", PyIEnumFORMATETC::Clone, 1 }, // @pymeth Clone|Creates another enumerator that contains the same enumeration state as the current one.
{ NULL }
};
PyComTypeObject PyIEnumFORMATETC::type("PyIEnumFORMATETC",
&PyIUnknown::type,
sizeof(PyIEnumFORMATETC),
PyIEnumFORMATETC_methods,
GET_PYCOM_CTOR(PyIEnumFORMATETC));
// ---------------------------------------------------
//
// Gateway Implementation
STDMETHODIMP PyGEnumFORMATETC::Next(
/* [in] */ ULONG celt,
/* [length_is][size_is][out] */ FORMATETC *pi,
/* [out] */ ULONG __RPC_FAR *pCeltFetched)
{
PY_GATEWAY_METHOD;
PyObject *result;
HRESULT hr = InvokeViaPolicy("Next", &result, "i", celt);
if ( FAILED(hr) )
return hr;
if ( !PySequence_Check(result) )
goto error;
int len;
len = PyObject_Length(result);
if ( len == -1 )
goto error;
if ( len > (int)celt)
len = celt;
if ( pCeltFetched )
*pCeltFetched = len;
int i;
for ( i = 0; i < len; ++i )
{
PyObject *ob = PySequence_GetItem(result, i);
if ( ob == NULL )
goto error;
if ( !PyObject_AsFORMATETC(ob, &pi[i] ))
{
Py_DECREF(result);
return PyCom_SetCOMErrorFromPyException(IID_IEnumFORMATETC);
}
}
Py_DECREF(result);
return len < (int)celt ? S_FALSE : S_OK;
error:
PyErr_Clear(); // just in case
Py_DECREF(result);
return PyCom_SetCOMErrorFromSimple(E_FAIL, IID_IEnumFORMATETC, "Next() did not return a sequence of objects");
}
STDMETHODIMP PyGEnumFORMATETC::Skip(
/* [in] */ ULONG celt)
{
PY_GATEWAY_METHOD;
return InvokeViaPolicy("Skip", NULL, "i", celt);
}
STDMETHODIMP PyGEnumFORMATETC::Reset(void)
{
PY_GATEWAY_METHOD;
return InvokeViaPolicy("Reset");
}
STDMETHODIMP PyGEnumFORMATETC::Clone(
/* [out] */ IEnumFORMATETC __RPC_FAR *__RPC_FAR *ppEnum)
{
PY_GATEWAY_METHOD;
PyObject * result;
HRESULT hr = InvokeViaPolicy("Clone", &result);
if ( FAILED(hr) )
return hr;
/*
** Make sure we have the right kind of object: we should have some kind
** of IUnknown subclass wrapped into a PyIUnknown instance.
*/
if ( !PyIBase::is_object(result, &PyIUnknown::type) )
{
/* the wrong kind of object was returned to us */
Py_DECREF(result);
return PyCom_SetCOMErrorFromSimple(E_FAIL, IID_IEnumFORMATETC);
}
/*
** Get the IUnknown out of the thing. note that the Python ob maintains
** a reference, so we don't have to explicitly AddRef() here.
*/
IUnknown *punk = ((PyIUnknown *)result)->m_obj;
if ( !punk )
{
/* damn. the object was released. */
Py_DECREF(result);
return PyCom_SetCOMErrorFromSimple(E_FAIL, IID_IEnumFORMATETC);
}
/*
** Get the interface we want. note it is returned with a refcount.
** This QI is actually going to instantiate a PyGEnumFORMATETC.
*/
Py_BEGIN_ALLOW_THREADS
hr = punk->QueryInterface(IID_IEnumFORMATETC, (LPVOID *)ppEnum);
Py_END_ALLOW_THREADS
/* done with the result; this DECREF is also for <punk> */
Py_DECREF(result);
return PyCom_SetCOMErrorFromSimple(hr, IID_IEnumFORMATETC, "Python could not convert the result from Next() into the required COM interface");
}
--- NEW FILE: PySTGMEDIUM.cpp ---
#include "stdafx.h"
#include "PythonCOM.h"
#include "structmember.h"
#include "PyComTypeObjects.h"
// @pymethod <o STGMEDIUM>|pythoncom|STGMEDIUM|Creates a new STGMEDIUM object
PyObject *Py_NewSTGMEDIUM(PyObject *self, PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return new PySTGMEDIUM();
}
PySTGMEDIUM *PyObject_FromSTGMEDIUM(STGMEDIUM *desc /* = NULL*/)
{
return new PySTGMEDIUM(desc);
}
PyObject *PySet(PyObject *self, PyObject *args)
{
int tymed;
PyObject *ob;
if (!PyArg_ParseTuple(args, "iO:set", &tymed, &ob))
return NULL;
PySTGMEDIUM *ps = (PySTGMEDIUM *)self;
ps->Close(); // ensure any old data clean
switch (tymed) {
case TYMED_GDI:
if (!PyInt_Check(ob) || !PyLong_Check(ob))
return PyErr_Format(PyExc_TypeError, "tymed value of %d requires an integer handle", tymed);
ps->medium.hBitmap = (HBITMAP)PyInt_AsLong(ob);
break;
case TYMED_MFPICT:
if (!PyInt_Check(ob) || !PyLong_Check(ob))
return PyErr_Format(PyExc_TypeError, "tymed value of %d requires an integer handle", tymed);
ps->medium.hMetaFilePict = (HMETAFILEPICT)PyInt_AsLong(ob);
break;
case TYMED_ENHMF:
if (!PyInt_Check(ob) || !PyLong_Check(ob))
return PyErr_Format(PyExc_TypeError, "tymed value of %d requires an integer handle", tymed);
ps->medium.hEnhMetaFile = (HENHMETAFILE)PyInt_AsLong(ob);
break;
case TYMED_HGLOBAL: {
// todo: support buffer
if (!PyString_Check(ob))
return PyErr_Format(PyExc_TypeError, "tymed value of %d requires a string", tymed);
ps->medium.hGlobal = GlobalAlloc(GMEM_FIXED, PyString_Size(ob));
if (!ps->medium.hGlobal)
return PyErr_NoMemory();
memcpy( (void *)ps->medium.hGlobal, PyString_AsString(ob), PyString_Size(ob));
break;
}
case TYMED_FILE:
if (!PyWinObject_AsTaskAllocatedWCHAR(ob, &ps->medium.lpszFileName, FALSE, NULL))
return FALSE;
break;
case TYMED_ISTREAM:
if (!PyCom_InterfaceFromPyInstanceOrObject(ob, IID_IStream, (void **)&ps->medium.pstm, FALSE/* bNoneOK */))
return FALSE;
break;
case TYMED_ISTORAGE:
if (!PyCom_InterfaceFromPyInstanceOrObject(ob, IID_IStorage, (void **)&ps->medium.pstg, FALSE/* bNoneOK */))
return FALSE;
break;
default:
PyErr_Format(PyExc_ValueError, "Unknown tymed value '%d'", tymed);
return NULL;
}
ps->medium.tymed = tymed;
Py_INCREF(Py_None);
return Py_None;
}
// @object STGMEDIUM|A STGMEDIUM object represents a COM STGMEDIUM structure.
static struct PyMethodDef PySTGMEDIUM_methods[] = {
{"set", PySet, 1}, // @pymeth set|Sets the type and data of the object
{NULL}
};
PyTypeObject PySTGMEDIUM::Type =
{
PyObject_HEAD_INIT(&PyType_Type)
0,
"PySTGMEDIUM",
sizeof(PySTGMEDIUM),
0,
PySTGMEDIUM::deallocFunc, /* tp_dealloc */
0, /* tp_print */
PySTGMEDIUM::getattr, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0,
0, /* tp_call */
0, /* tp_str */
};
#define OFF(e) offsetof(PySTGMEDIUM, e)
PySTGMEDIUM::PySTGMEDIUM(STGMEDIUM *pm)
{
ob_type = &PySTGMEDIUM::Type;
_Py_NewReference(this);
if (pm)
memcpy(&medium, pm, sizeof(medium));
else
memset(&medium, 0, sizeof(medium));
}
PySTGMEDIUM::~PySTGMEDIUM()
{
Close();
}
void PySTGMEDIUM::DropOwnership()
{
memset(&medium, 0, sizeof(medium));
}
void PySTGMEDIUM::Close()
{
if (medium.tymed) {
ReleaseStgMedium(&medium);
memset(&medium, 0, sizeof(medium));
assert(!medium.tymed);
}
}
PyObject *PySTGMEDIUM::getattr(PyObject *self, char *name)
{
PyObject *res;
PySTGMEDIUM *ps = (PySTGMEDIUM *)self;
res = Py_FindMethod(PySTGMEDIUM_methods, self, name);
if (res != NULL)
return res;
PyErr_Clear();
if (strcmp(name, "tymed")==0)
return PyInt_FromLong(ps->medium.tymed);
if (strcmp(name, "data")==0) {
switch (ps->medium.tymed) {
case TYMED_GDI:
return PyLong_FromVoidPtr(ps->medium.hBitmap);
case TYMED_MFPICT:
return PyLong_FromVoidPtr(ps->medium.hMetaFilePict);
case TYMED_ENHMF:
return PyLong_FromVoidPtr(ps->medium.hEnhMetaFile);
case TYMED_HGLOBAL: {
PyObject *ret;
void *p = GlobalLock(ps->medium.hGlobal);
if (p) {
ret = PyString_FromStringAndSize( (char *)p, GlobalSize(ps->medium.hGlobal));
GlobalUnlock(ps->medium.hGlobal);
} else {
ret = Py_None;
Py_INCREF(Py_None);
}
return ret;
}
case TYMED_FILE:
return PyWinObject_FromWCHAR(ps->medium.lpszFileName);
case TYMED_ISTREAM:
return PyCom_PyObjectFromIUnknown(ps->medium.pstm, IID_IStream, TRUE);
case TYMED_ISTORAGE:
return PyCom_PyObjectFromIUnknown(ps->medium.pstg, IID_IStorage, TRUE);
case TYMED_NULL:
PyErr_SetString(PyExc_ValueError, "This STGMEDIUM has no data");
return NULL;
default:
PyErr_SetString(PyExc_RuntimeError, "Unknown tymed");
return NULL;
}
}
return PyErr_Format(PyExc_AttributeError, "STGMEDIUM objects have no attribute '%s'", name);
}
/*static*/ void PySTGMEDIUM::deallocFunc(PyObject *ob)
{
delete (PySTGMEDIUM *)ob;
}
|
|
From: <mha...@us...> - 2003-10-08 04:28:46
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include
In directory sc8-pr-cvs1:/tmp/cvs-serv13856/include
Modified Files:
PyComTypeObjects.h
Added Files:
PyIDataObject.h PyIEnumFORMATETC.h
Log Message:
Add IDataFormat and support for FORMATETC and STGMEDIUM
--- NEW FILE: PyIDataObject.h ---
// This file declares the IDataObject Interface and Gateway for Python.
// Generated by makegw.py
// ---------------------------------------------------
//
// Interface Declaration
class PyIDataObject : public PyIUnknown
{
public:
MAKE_PYCOM_CTOR(PyIDataObject);
static IDataObject *GetI(PyObject *self);
static PyComTypeObject type;
// The Python methods
static PyObject *GetData(PyObject *self, PyObject *args);
static PyObject *GetDataHere(PyObject *self, PyObject *args);
static PyObject *QueryGetData(PyObject *self, PyObject *args);
static PyObject *GetCanonicalFormatEtc(PyObject *self, PyObject *args);
static PyObject *SetData(PyObject *self, PyObject *args);
static PyObject *EnumFormatEtc(PyObject *self, PyObject *args);
static PyObject *DAdvise(PyObject *self, PyObject *args);
static PyObject *DUnadvise(PyObject *self, PyObject *args);
static PyObject *EnumDAdvise(PyObject *self, PyObject *args);
protected:
PyIDataObject(IUnknown *pdisp);
~PyIDataObject();
};
// ---------------------------------------------------
//
// Gateway Declaration
class PyGDataObject : public PyGatewayBase, public IDataObject
{
protected:
PyGDataObject(PyObject *instance) : PyGatewayBase(instance) { ; }
PYGATEWAY_MAKE_SUPPORT2(PyGDataObject, IDataObject, IID_IDataObject, PyGatewayBase)
// IDataObject
STDMETHOD(GetData)(
FORMATETC * pformatetcIn,
STGMEDIUM * pmedium);
STDMETHOD(GetDataHere)(
FORMATETC * pformatetc,
STGMEDIUM * pmedium);
STDMETHOD(QueryGetData)(
FORMATETC * pformatetc);
STDMETHOD(GetCanonicalFormatEtc)(
FORMATETC * pformatectIn,
FORMATETC * pformatetcOut);
STDMETHOD(SetData)(
FORMATETC * pformatetc,
STGMEDIUM * pmedium,
BOOL fRelease);
STDMETHOD(EnumFormatEtc)(
DWORD dwDirection,
IEnumFORMATETC ** ppenumFormatEtc);
STDMETHOD(DAdvise)(
FORMATETC * pformatetc,
DWORD advf,
IAdviseSink * pAdvSink,
DWORD * pdwConnection);
STDMETHOD(DUnadvise)(
DWORD dwConnection);
STDMETHOD(EnumDAdvise)(
IEnumSTATDATA ** ppenumAdvise);
};
--- NEW FILE: PyIEnumFORMATETC.h ---
// This file declares the IEnumFORMATETC Interface and Gateway for Python.
// Generated by makegw.py
// ---------------------------------------------------
//
// Interface Declaration
class PyIEnumFORMATETC : public PyIUnknown
{
public:
MAKE_PYCOM_CTOR(PyIEnumFORMATETC);
static IEnumFORMATETC *GetI(PyObject *self);
static PyComTypeObject type;
virtual PyObject *iter();
virtual PyObject *iternext();
// The Python methods
static PyObject *Next(PyObject *self, PyObject *args);
static PyObject *Skip(PyObject *self, PyObject *args);
static PyObject *Reset(PyObject *self, PyObject *args);
static PyObject *Clone(PyObject *self, PyObject *args);
protected:
PyIEnumFORMATETC(IUnknown *pdisp);
~PyIEnumFORMATETC();
};
// ---------------------------------------------------
//
// Gateway Declaration
class PyGEnumFORMATETC : public PyGatewayBase, public IEnumFORMATETC
{
protected:
PyGEnumFORMATETC(PyObject *instance) : PyGatewayBase(instance) { ; }
PYGATEWAY_MAKE_SUPPORT2(PyGEnumFORMATETC, IEnumFORMATETC, IID_IEnumFORMATETC, PyGatewayBase)
// IEnumFORMATETC
STDMETHOD(Next)(
ULONG celt,
FORMATETC *pi,
ULONG __RPC_FAR * pcEltsfetched);
STDMETHOD(Skip)(
ULONG celt);
STDMETHOD(Reset)(
void);
STDMETHOD(Clone)(
IEnumFORMATETC __RPC_FAR *__RPC_FAR * ppepi);
};
Index: PyComTypeObjects.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyComTypeObjects.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PyComTypeObjects.h 1 Sep 1999 23:04:13 -0000 1.1
--- PyComTypeObjects.h 8 Oct 2003 04:28:42 -0000 1.2
***************
*** 119,120 ****
--- 119,140 ----
int varkind;
};
+
+ class PYCOM_EXPORT PySTGMEDIUM : public PyObject
+ {
+ public:
+ PySTGMEDIUM(STGMEDIUM *pS = NULL);
+ virtual ~PySTGMEDIUM(void);
+
+ void DropOwnership(void);
+ void Close(void);
+ static void deallocFunc(PyObject *ob);
+ static PyObject *getattr(PyObject *self, char *name);
+ STGMEDIUM medium;
+ #pragma warning( disable : 4251 )
+ static struct memberlist memberlist[];
+ static PyTypeObject Type;
+ #pragma warning( default : 4251 )
+ };
+
+ PYCOM_EXPORT PySTGMEDIUM *PyObject_FromSTGMEDIUM(STGMEDIUM *desc = NULL);
+ #define PySTGMEDIUM_Check(x) ((x)->ob_type==&PySTGMEDIUM::Type)
|
|
From: <mha...@us...> - 2003-10-08 04:28:46
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src
In directory sc8-pr-cvs1:/tmp/cvs-serv13856
Modified Files:
PythonCOM.cpp Register.cpp
Log Message:
Add IDataFormat and support for FORMATETC and STGMEDIUM
Index: PythonCOM.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PythonCOM.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** PythonCOM.cpp 7 Jul 2003 14:10:53 -0000 1.20
--- PythonCOM.cpp 8 Oct 2003 04:28:42 -0000 1.21
***************
*** 42,45 ****
--- 42,47 ----
extern PyObject *pythoncom_GetRecordFromGuids(PyObject *self, PyObject *args);
+ extern PyObject *Py_NewSTGMEDIUM(PyObject *self, PyObject *args);
+
// Typelib related functions
***************
*** 1335,1338 ****
--- 1337,1420 ----
}
+ // @pymeth <o PyIDataObject>|OleGetClipboard|Retrieves a data object that you can use to access the contents of the clipboard.
+ static PyObject *pythoncom_OleGetClipboard(PyObject *, PyObject *args)
+ {
+ if (!PyArg_ParseTuple(args, ":OleGetClipboard"))
+ return NULL;
+ IDataObject *pd = NULL;
+ HRESULT hr;
+ Py_BEGIN_ALLOW_THREADS
+ hr = ::OleGetClipboard(&pd);
+ Py_END_ALLOW_THREADS
+ if (FAILED(hr)) {
+ PyCom_BuildPyException(hr);
+ return NULL;
+ }
+ return PyCom_PyObjectFromIUnknown(pd, IID_IDataObject, FALSE);
+ }
+
+ // @pymeth |OleSetClipboard|Places a pointer to a specific data object onto the clipboard. This makes the data object accessible to the OleGetClipboard function.
+ static PyObject *pythoncom_OleSetClipboard(PyObject *, PyObject *args)
+ {
+ PyObject *obd;
+ if (!PyArg_ParseTuple(args, "O:OleSetClipboard", &obd))
+ return NULL;
+ IDataObject *pd;
+ if (!PyCom_InterfaceFromPyObject(obd, IID_IDataObject, (void**)&pd, FALSE))
+ return NULL;
+ HRESULT hr;
+ Py_BEGIN_ALLOW_THREADS
+ hr = ::OleSetClipboard(pd);
+ Py_END_ALLOW_THREADS
+ pd->Release();
+ if (FAILED(hr)) {
+ PyCom_BuildPyException(hr);
+ return NULL;
+ }
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
+ // @pymeth true/false|OleIsCurrentClipboard|Determines whether the data object pointer previously placed on the clipboard by the OleSetClipboard function is still on the clipboard.
+ static PyObject *pythoncom_OleIsCurrentClipboard(PyObject *, PyObject *args)
+ {
+ PyObject *obd;
+ if (!PyArg_ParseTuple(args, "O:OleIsCurrentClipboard", &obd))
+ return NULL;
+ IDataObject *pd;
+ if (!PyCom_InterfaceFromPyObject(obd, IID_IDataObject, (void**)&pd, FALSE))
+ return NULL;
+ HRESULT hr;
+ Py_BEGIN_ALLOW_THREADS
+ hr = ::OleIsCurrentClipboard(pd);
+ Py_END_ALLOW_THREADS
+ pd->Release();
+ if (FAILED(hr)) {
+ PyCom_BuildPyException(hr);
+ return NULL;
+ }
+ PyObject *ret = hr==S_OK ? Py_True: Py_False;
+ Py_INCREF(ret);
+ return ret;
+ }
+
+ // @pymeth |OleFlushClipboard|Carries out the clipboard shutdown sequence. It also releases the IDataObject pointer that was placed on the clipboard by the <om pythoncom.OleSetClipboard> function.
+ static PyObject *pythoncom_OleFlushClipboard(PyObject *, PyObject *args)
+ {
+ if (!PyArg_ParseTuple(args, ":OleFlushClipboard"))
+ return NULL;
+
+ HRESULT hr;
+ Py_BEGIN_ALLOW_THREADS
+ hr = ::OleFlushClipboard();
+ Py_END_ALLOW_THREADS
+ if (FAILED(hr)) {
+ PyCom_BuildPyException(hr);
+ return NULL;
+ }
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
***************
*** 1395,1398 ****
--- 1477,1484 ----
{ "new", pythoncom_new, 1 },
{ "New", pythoncom_new, 1 }, // @pymeth New|Create a new instance of an OLE automation server.
+ { "OleGetClipboard", pythoncom_OleGetClipboard, 1}, // @pymeth OleGetClipboard|Retrieves a data object that you can use to access the contents of the clipboard.
+ { "OleFlushClipboard", pythoncom_OleFlushClipboard, 1}, // @pymeth OleFlushClipboard|Carries out the clipboard shutdown sequence. It also releases the IDataObject pointer that was placed on the clipboard by the <om pythoncom.OleSetClipboard> function.
+ { "OleIsCurrentClipboard",pythoncom_OleIsCurrentClipboard, 1}, // @pymeth OleIsCurrentClipboard|Determines whether the data object pointer previously placed on the clipboard by the OleSetClipboard function is still on the clipboard.
+ { "OleSetClipboard", pythoncom_OleSetClipboard, 1}, // @pymeth OleSetClipboard|Places a pointer to a specific data object onto the clipboard. This makes the data object accessible to the OleGetClipboard function.
{ "OleLoadFromStream", pythoncom_OleLoadFromStream, 1}, // @pymeth OleLoadFromStream|Load an object from an IStream.
{ "OleSaveToStream", pythoncom_OleSaveToStream, 1}, // @pymeth OleSaveToStream|Save an object to an IStream.
***************
*** 1420,1423 ****
--- 1506,1510 ----
{ "StgIsStorageFile", pythoncom_StgIsStorageFile, 1 }, // @pymeth StgIsStorageFile|Indicates whether a particular disk file contains a storage object.
#endif // MS_WINCE
+ { "STGMEDIUM", Py_NewSTGMEDIUM, 1}, // @pymeth STGMEDIUM|Creates a new <o PySTGMEDIUM> object suitable for the <o PyIDataObject> interface.
{ "StgOpenStorage", pythoncom_StgOpenStorage, 1 }, // @pymeth StgOpenStorage|Opens an existing root storage object in the file system.
{ "TYPEATTR", Py_NewTYPEATTR, 1}, // @pymeth TYPEATTR|Returns a new <o TYPEATTR> object.
***************
*** 1556,1559 ****
--- 1643,1658 ----
ADD_CONSTANT(COINIT_SPEED_OVER_MEMORY);
#endif
+ // CLIPBOARD
+ ADD_CONSTANT(DATADIR_GET);
+ ADD_CONSTANT(DATADIR_SET);
+ ADD_CONSTANT(TYMED_HGLOBAL);
+ ADD_CONSTANT(TYMED_FILE);
+ ADD_CONSTANT(TYMED_ISTREAM);
+ ADD_CONSTANT(TYMED_ISTORAGE);
+ ADD_CONSTANT(TYMED_GDI);
+ ADD_CONSTANT(TYMED_MFPICT);
+ ADD_CONSTANT(TYMED_ENHMF);
+ ADD_CONSTANT(TYMED_NULL);
+
// DISPATCH
ADD_CONSTANT(DISPATCH_PROPERTYGET);
Index: Register.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/Register.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Register.cpp 7 Jul 2003 14:10:53 -0000 1.8
--- Register.cpp 8 Oct 2003 04:28:42 -0000 1.9
***************
*** 46,49 ****
--- 46,51 ----
#include "PyIPropertySetStorage.h"
#include "PyIEnumSTATPROPSTG.h"
+ #include "PyIEnumFORMATETC.h"
+ #include "PyIDataObject.h"
//PyObject *CLSIDMapping; // Maps CLSIDs onto PyClassObjects
***************
*** 222,225 ****
--- 224,228 ----
PYCOM_INTERFACE_CLIENT_ONLY( CreateTypeInfo),
PYCOM_INTERFACE_CLIENT_ONLY( CreateTypeLib),
+ PYCOM_INTERFACE_FULL ( DataObject ),
#ifndef NO_PYCOM_IENUMCATEGORYINFO
PYCOM_INTERFACE_CLIENT_ONLY( EnumCATEGORYINFO),
***************
*** 227,230 ****
--- 230,234 ----
PYCOM_INTERFACE_FULL ( EnumConnectionPoints),
PYCOM_INTERFACE_FULL ( EnumConnections),
+ PYCOM_INTERFACE_FULL ( EnumFORMATETC),
#ifndef NO_PYCOM_IENUMGUID
PYCOM_INTERFACE_CLIENT_ONLY( EnumGUID),
|
|
From: <mha...@us...> - 2003-10-08 04:26:03
|
Update of /cvsroot/pywin32/pywin32/com/win32com/demos
In directory sc8-pr-cvs1:/tmp/cvs-serv13592
Added Files:
dump_clipboard.py
Log Message:
Demo of extracting clipboard data using COM.
--- NEW FILE: dump_clipboard.py ---
import pythoncom
import win32con
formats = """CF_TEXT CF_BITMAP CF_METAFILEPICT CF_SYLK CF_DIF CF_TIFF
CF_OEMTEXT CF_DIB CF_PALETTE CF_PENDATA CF_RIFF CF_WAVE
CF_UNICODETEXT CF_ENHMETAFILE CF_HDROP CF_LOCALE CF_MAX
CF_OWNERDISPLAY CF_DSPTEXT CF_DSPBITMAP CF_DSPMETAFILEPICT
CF_DSPENHMETAFILE""".split()
format_name_map = {}
for f in formats:
val = getattr(win32con, f)
format_name_map[val]=f
tymeds = [attr for attr in pythoncom.__dict__.keys() if attr.startswith("TYMED_")]
def DumpClipboard():
do = pythoncom.OleGetClipboard()
print "Dumping all clipboard formats..."
for fe in do.EnumFormatEtc():
fmt, td, aspect, index, tymed = fe
tymeds_this = [getattr(pythoncom, t) for t in tymeds if tymed & getattr(pythoncom, t)]
print "Clipboard format", format_name_map.get(fmt,str(fmt))
for t_this in tymeds_this:
# As we are enumerating there should be no need to call
# QueryGetData, but we do anyway!
fetc_query = fmt, td, aspect, index, t_this
try:
do.QueryGetData(fetc_query)
except pythoncom.com_error:
print "Eeek - QGD indicated failure for tymed", t_this
# now actually get it.
medium = do.GetData(fetc_query)
if medium.tymed==pythoncom.TYMED_GDI:
data = "GDI handle %d" % medium.data
elif medium.tymed==pythoncom.TYMED_MFPICT:
data = "METAFILE handle %d" % medium.data
elif medium.tymed==pythoncom.TYMED_ENHMF:
data = "ENHMETAFILE handle %d" % medium.data
elif medium.tymed==pythoncom.TYMED_HGLOBAL:
data = "%d bytes via HGLOBAL" % len(medium.data)
elif medium.tymed==pythoncom.TYMED_FILE:
data = "filename '%s'" % data
elif medium.tymed==pythoncom.TYMED_ISTREAM:
stream = medium.data
stream.Seek(0,0)
bytes = 0
while 1:
chunk = stream.Read(4096)
if not chunk:
break
bytes += len(chunk)
data = "%d bytes via IStream" % bytes
elif medium.tymed==pythoncom.TYMED_ISTORAGE:
data = "a IStorage"
else:
data = "*** unknown tymed!"
print " -> got", data
do = None
if __name__=='__main__':
DumpClipboard()
if pythoncom._GetInterfaceCount()+pythoncom._GetGatewayCount():
print "XXX - Leaving with %d/%d COM objects alive" % \
(pythoncom._GetInterfaceCount(), pythoncom._GetGatewayCount())
|
|
From: <mha...@us...> - 2003-10-08 00:15:17
|
Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1:/tmp/cvs-serv11854
Modified Files:
PythonService.cpp
Log Message:
Sheesh - I checked in a file that doesn't build :(
Index: PythonService.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/PythonService.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** PythonService.cpp 6 Oct 2003 13:01:49 -0000 1.5
--- PythonService.cpp 8 Oct 2003 00:14:58 -0000 1.6
***************
*** 481,485 ****
printf(" -debug servicename [parms] - debug the Python service.\n");
printf("\nNOTE: You do not start the service using this program - start the\n");
! printf("service using Control Panel, or 'net start %s'\n", svcName);
printf("\nConnecting to the service control manager....\n");
--- 481,485 ----
printf(" -debug servicename [parms] - debug the Python service.\n");
printf("\nNOTE: You do not start the service using this program - start the\n");
! printf("service using Control Panel, or 'net start service_name'\n");
printf("\nConnecting to the service control manager....\n");
|
|
From: <mha...@us...> - 2003-10-07 05:14:07
|
Update of /cvsroot/pywin32/pywin32/com In directory sc8-pr-cvs1:/tmp/cvs-serv19760 Modified Files: shell.dsp Log Message: Add PyICopyHook Index: shell.dsp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/shell.dsp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shell.dsp 6 Oct 2003 12:48:51 -0000 1.6 --- shell.dsp 7 Oct 2003 05:14:03 -0000 1.7 *************** *** 99,102 **** --- 99,106 ---- # Begin Source File + SOURCE=.\win32comext\shell\src\PyICopyHook.cpp + # End Source File + # Begin Source File + SOURCE=.\win32comext\shell\src\PyIEnumIDList.cpp # End Source File *************** *** 128,131 **** --- 132,139 ---- SOURCE=.\win32comext\shell\src\PyIContextMenu.h + # End Source File + # Begin Source File + + SOURCE=.\win32comext\shell\src\PyICopyHook.h # End Source File # Begin Source File |
|
From: <mha...@us...> - 2003-10-07 05:13:29
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src
In directory sc8-pr-cvs1:/tmp/cvs-serv19672/src
Modified Files:
shell.cpp
Added Files:
PyICopyHook.cpp PyICopyHook.h
Log Message:
Support ICopyHook
--- NEW FILE: PyICopyHook.cpp ---
// This file implements the ICopyHook Interface and Gateway for Python.
// Generated by makegw.py
#include "shell_pch.h"
#include "PyICopyHook.h"
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
// Interface Implementation
PyICopyHook::PyICopyHook(IUnknown *pdisp):
PyIUnknown(pdisp)
{
ob_type = &type;
}
PyICopyHook::~PyICopyHook()
{
}
/* static */ ICopyHook *PyICopyHook::GetI(PyObject *self)
{
return (ICopyHook *)PyIUnknown::GetI(self);
}
// @pymethod |PyICopyHook|CopyCallback|Description of CopyCallback.
PyObject *PyICopyHook::CopyCallback(PyObject *self, PyObject *args)
{
ICopyHook *pICH = GetI(self);
if ( pICH == NULL )
return NULL;
// @pyparm HWND|hwnd||Description for hwnd
// @pyparm int|wFunc||Description for wFunc
// @pyparm int|wFlags||Description for wFlags
// @pyparm string/<o unicode>|srcFile||Description for srcFile
// @pyparm int|srcAttribs||Description for srcAttribs
// @pyparm string/<o unicode>|destFile||Description for destFile
// @pyparm int|destAttribs||Description for destAttribs
PyObject *obsrcFile;
PyObject *obdestFile;
HWND hwnd;
UINT wFunc;
UINT wFlags;
LPTSTR srcFile;
DWORD srcAttribs;
LPTSTR destFile;
DWORD destAttribs;
if ( !PyArg_ParseTuple(args, "liiOlOl:CopyCallback", &hwnd, &wFunc, &wFlags, &obsrcFile, &srcAttribs, &obdestFile, &destAttribs) )
return NULL;
BOOL bPythonIsHappy = TRUE;
if (bPythonIsHappy && !PyWinObject_AsTCHAR(obsrcFile, &srcFile)) bPythonIsHappy = FALSE;
if (bPythonIsHappy && !PyWinObject_AsTCHAR(obdestFile, &destFile)) bPythonIsHappy = FALSE;
if (!bPythonIsHappy) return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
hr = pICH->CopyCallback( hwnd, wFunc, wFlags, srcFile, srcAttribs, destFile, destAttribs );
PyWinObject_FreeTCHAR(srcFile);
PyWinObject_FreeTCHAR(destFile);
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, pICH, IID_IShellCopyHook );
Py_INCREF(Py_None);
return Py_None;
}
// @object PyICopyHook|Description of the interface
static struct PyMethodDef PyICopyHook_methods[] =
{
{ "CopyCallback", PyICopyHook::CopyCallback, 1 }, // @pymeth CopyCallback|Description of CopyCallback
{ NULL }
};
PyComTypeObject PyICopyHook::type("PyICopyHook",
&PyIUnknown::type,
sizeof(PyICopyHook),
PyICopyHook_methods,
GET_PYCOM_CTOR(PyICopyHook));
// ---------------------------------------------------
//
// Gateway Implementation
STDMETHODIMP_(UINT) PyGCopyHook::CopyCallback(
/* [unique][in] */ HWND hwnd,
/* [unique][in] */ UINT wFunc,
/* [unique][in] */ UINT wFlags,
/* [unique][in] */ LPCTSTR srcFile,
/* [unique][in] */ DWORD srcAttribs,
/* [unique][in] */ LPCTSTR destFile,
/* [unique][in] */ DWORD destAttribs)
{
PY_GATEWAY_METHOD;
PyObject *obsrcFile;
PyObject *obdestFile;
obsrcFile = PyWinObject_FromTCHAR((LPTSTR)srcFile);
obdestFile = PyWinObject_FromTCHAR((LPTSTR)destFile);
PyObject *result;
HRESULT hr=InvokeViaPolicy("CopyCallback", &result, "liiOlOl", hwnd, wFunc, wFlags, obsrcFile, srcAttribs, obdestFile, destAttribs);
Py_XDECREF(obsrcFile);
Py_XDECREF(obdestFile);
if (FAILED(hr)) return hr;
if (!PyInt_Check(result) || !PyLong_Check(result)) {
PyErr_Format(PyExc_TypeError, "CopyCallBack should return an int, not a '%s'", result->ob_type->tp_name);
hr = PyCom_HandlePythonFailureToCOM(/*pexcepinfo*/);
} else
hr = PyInt_AsLong(result);
Py_DECREF(result);
return hr;
}
--- NEW FILE: PyICopyHook.h ---
// This file declares the ICopyHook Interface and Gateway for Python.
// Generated by makegw.py
// ---------------------------------------------------
//
// Interface Declaration
class PyICopyHook : public PyIUnknown
{
public:
MAKE_PYCOM_CTOR(PyICopyHook);
static ICopyHook *GetI(PyObject *self);
static PyComTypeObject type;
// The Python methods
static PyObject *CopyCallback(PyObject *self, PyObject *args);
protected:
PyICopyHook(IUnknown *pdisp);
~PyICopyHook();
};
// ---------------------------------------------------
//
// Gateway Declaration
class PyGCopyHook : public PyGatewayBase, public ICopyHook
{
protected:
PyGCopyHook(PyObject *instance) : PyGatewayBase(instance) { ; }
PYGATEWAY_MAKE_SUPPORT2(PyGCopyHook, ICopyHook, IID_IShellCopyHook, PyGatewayBase)
// ICopyHook
STDMETHOD_(UINT, CopyCallback)(
HWND hwnd,
UINT wFunc,
UINT wFlags,
LPCTSTR srcFile,
DWORD srcAttribs,
LPCTSTR destFile,
DWORD destAttribs);
};
Index: shell.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** shell.cpp 7 Oct 2003 02:31:08 -0000 1.7
--- shell.cpp 7 Oct 2003 05:13:22 -0000 1.8
***************
*** 20,23 ****
--- 20,24 ----
#include "PyIShellFolder.h"
#include "PyIEnumIDList.h"
+ #include "PyICopyHook.h"
#include "PythonCOMRegister.h" // For simpler registration of IIDs etc.
***************
*** 669,672 ****
--- 670,676 ----
PYCOM_INTERFACE_FULL(ShellFolder),
PYCOM_INTERFACE_FULL(EnumIDList),
+ // IID_ICopyHook doesn't exist - hack it up
+ { &IID_IShellCopyHook, "IShellCopyHook", "IID_IShellCopyHook", &PyICopyHook::type, GET_PYGATEWAY_CTOR(PyGCopyHook) },
+ { &IID_IShellCopyHook, "ICopyHook", "IID_ICopyHook", NULL, NULL },
};
|
|
From: <mha...@us...> - 2003-10-07 05:13:29
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers
In directory sc8-pr-cvs1:/tmp/cvs-serv19672/demos/servers
Added Files:
copy_hook.py
Log Message:
Support ICopyHook
--- NEW FILE: copy_hook.py ---
# A sample shell copy hook.
# To demostrate:
# * Execute this script to register the context menu.
# * Open Windows Explorer, and browse to a directory with a .py file.
# * Note the pretty, random selection of icons!
import sys, os
import pythoncom
from win32com.shell import shell, shellcon
import win32gui
import win32con
import winerror
# Our shell extension.
class ShellExtension:
_reg_progid_ = "Python.ShellExtension.CopyHook"
_reg_desc_ = "Python Sample Shell Extension (copy hook)"
_reg_clsid_ = "{1845b6ba-2bbd-4197-b930-46d8651497c1}"
_com_interfaces_ = [shell.IID_ICopyHook]
_public_methods_ = ["CopyCallBack"]
def CopyCallBack(self, hwnd, func, flags,
srcName, srcAttr, destName, destAttr):
# This function should return:
# IDYES Allows the operation.
# IDNO Prevents the operation on this folder but continues with any other operations that have been approved (for example, a batch copy operation).
# IDCANCEL Prevents the current operation and cancels any pending operations.
print "CopyCallBack", hwnd, func, flags, srcName, srcAttr, destName, destAttr
return win32gui.MessageBox(hwnd, "Allow operation?", "CopyHook",
win32con.MB_YESNO)
def DllRegisterServer():
import _winreg
key = _winreg.CreateKey(_winreg.HKEY_CLASSES_ROOT,
"directory\\shellex\\CopyHookHandlers\\" +
ShellExtension._reg_desc_)
_winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ShellExtension._reg_clsid_)
key = _winreg.CreateKey(_winreg.HKEY_CLASSES_ROOT,
"*\\shellex\\CopyHookHandlers\\" +
ShellExtension._reg_desc_)
_winreg.SetValueEx(key, None, 0, _winreg.REG_SZ, ShellExtension._reg_clsid_)
print ShellExtension._reg_desc_, "registration complete."
def DllUnregisterServer():
import _winreg
try:
key = _winreg.DeleteKey(_winreg.HKEY_CLASSES_ROOT,
"directory\\shellex\\CopyHookHandlers\\" +
ShellExtension._reg_desc_)
except WindowsError, details:
import errno
if details.errno != errno.ENOENT:
raise
try:
key = _winreg.DeleteKey(_winreg.HKEY_CLASSES_ROOT,
"*\\shellex\\CopyHookHandlers\\" +
ShellExtension._reg_desc_)
except WindowsError, details:
import errno
if details.errno != errno.ENOENT:
raise
print ShellExtension._reg_desc_, "unregistration complete."
if __name__=='__main__':
from win32com.server import register
register.UseCommandLine(ShellExtension,
finalize_register = DllRegisterServer,
finalize_unregister = DllUnregisterServer)
#!/usr/bin/env python
|
|
From: <mha...@us...> - 2003-10-07 02:33:05
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers
In directory sc8-pr-cvs1:/tmp/cvs-serv2259
Added Files:
icon_handler.py
Log Message:
Demo of a shell icon handler.
--- NEW FILE: icon_handler.py ---
# A sample icon handler. Sets the icon for Python files to a random
# ICO file. ICO files are found in the Python directory - generally there will
# be 3 icons found.
#
# To demostrate:
# * Execute this script to register the context menu.
# * Open Windows Explorer, and browse to a directory with a .py file.
# * Note the pretty, random selection of icons!
import sys, os
import pythoncom
from win32com.shell import shell, shellcon
import win32gui
import win32con
import winerror
# Use glob to locate ico files, and random.choice to pick one.
import glob, random
ico_files = glob.glob(os.path.join(sys.prefix, "*.ico"))
if not ico_files:
ico_files = glob.glob(os.path.join(sys.prefix, "PC", "*.ico"))
if not ico_files:
print "WARNING: Can't find any icon files"
# Our shell extension.
IExtractIcon_Methods = "Extract GetIconLocation".split()
IPersistFile_Methods = "IsDirty Load Save SaveCompleted GetCurFile".split()
class ShellExtension:
_reg_progid_ = "Python.ShellExtension.IconHandler"
_reg_desc_ = "Python Sample Shell Extension (icon handler)"
_reg_clsid_ = "{a97e32d7-3b78-448c-b341-418120ea9227}"
_com_interfaces_ = [shell.IID_IExtractIcon, pythoncom.IID_IPersistFile]
_public_methods_ = IExtractIcon_Methods + IPersistFile_Methods
def Load(self, filename, mode):
self.filename = filename
self.mode = mode
def GetIconLocation(self, flags):
# note - returning a single int will set the HRESULT (eg, S_FALSE,
# E_PENDING - see MS docs for details.
return random.choice(ico_files), 0, 0
def Extract(self, fname, index, size):
return winerror.S_FALSE
def DllRegisterServer():
import _winreg
key = _winreg.CreateKey(_winreg.HKEY_CLASSES_ROOT,
"Python.File\\shellex")
subkey = _winreg.CreateKey(key, "IconHandler")
_winreg.SetValueEx(subkey, None, 0, _winreg.REG_SZ, ShellExtension._reg_clsid_)
print ShellExtension._reg_desc_, "registration complete."
def DllUnregisterServer():
import _winreg
try:
key = _winreg.DeleteKey(_winreg.HKEY_CLASSES_ROOT,
"Python.File\\shellex\\IconHandler")
except WindowsError, details:
import errno
if details.errno != errno.ENOENT:
raise
print ShellExtension._reg_desc_, "unregistration complete."
if __name__=='__main__':
from win32com.server import register
register.UseCommandLine(ShellExtension,
finalize_register = DllRegisterServer,
finalize_unregister = DllUnregisterServer)
|
|
From: <mha...@us...> - 2003-10-07 02:32:15
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src
In directory sc8-pr-cvs1:/tmp/cvs-serv2042
Modified Files:
PyIExtractIcon.cpp PyIExtractIcon.h
Log Message:
Make Unicode aware, and allow the IExtractIcon interfaces to return a
different HRESULT rather than the values.
Index: PyIExtractIcon.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIExtractIcon.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PyIExtractIcon.cpp 6 Oct 2003 12:47:57 -0000 1.1
--- PyIExtractIcon.cpp 7 Oct 2003 02:32:11 -0000 1.2
***************
*** 1,8 ****
// This file implements the IExtractIcon Interface and Gateway for Python.
// Generated by makegw.py
-
#include "shell_pch.h"
#include "PyIExtractIcon.h"
-
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
--- 1,6 ----
***************
*** 70,74 ****
if ( !PyArg_ParseTuple(args, "i|i:GetIconLocation", &uFlags, &cchMax))
return NULL;
! TCHAR *buf = (char *)malloc(cchMax * sizeof(TCHAR));
if (!buf)
return PyErr_NoMemory();
--- 68,72 ----
if ( !PyArg_ParseTuple(args, "i|i:GetIconLocation", &uFlags, &cchMax))
return NULL;
! TCHAR *buf = (TCHAR *)malloc(cchMax * sizeof(TCHAR));
if (!buf)
return PyErr_NoMemory();
***************
*** 105,109 ****
// Gateway Implementation
STDMETHODIMP PyGExtractIcon::Extract(
! /* [unique][in] */ LPCSTR pszFile,
/* [unique][in] */ UINT nIconIndex,
/* [out] */ HICON * phiconLarge,
--- 103,107 ----
// Gateway Implementation
STDMETHODIMP PyGExtractIcon::Extract(
! /* [unique][in] */ LPCTSTR pszFile,
/* [unique][in] */ UINT nIconIndex,
/* [out] */ HICON * phiconLarge,
***************
*** 113,128 ****
PY_GATEWAY_METHOD;
PyObject *obpszFile;
! obpszFile = PyWinObject_FromTCHAR((LPSTR)pszFile);
PyObject *result;
HRESULT hr=InvokeViaPolicy("Extract", &result, "Oii", obpszFile, nIconIndex, nIconSize);
Py_XDECREF(obpszFile);
if (FAILED(hr)) return hr;
! PyArg_ParseTuple(result, "ii", phiconLarge, phiconSmall);
! return PyCom_HandlePythonFailureToCOM();
}
STDMETHODIMP PyGExtractIcon::GetIconLocation(
/* [unique][in] */ UINT uFlags,
! /* [unique][out] */ LPSTR szIconFile,
/* [unique][in] */ UINT cchMax,
/* [unique][out] */ LPINT piIndex,
--- 111,133 ----
PY_GATEWAY_METHOD;
PyObject *obpszFile;
! obpszFile = PyWinObject_FromTCHAR((LPTSTR)pszFile);
PyObject *result;
HRESULT hr=InvokeViaPolicy("Extract", &result, "Oii", obpszFile, nIconIndex, nIconSize);
Py_XDECREF(obpszFile);
if (FAILED(hr)) return hr;
! if (PyInt_Check(result) || PyLong_Check(result))
! hr = PyInt_AsLong(result);
! else {
! PyArg_ParseTuple(result, "ii", phiconLarge, phiconSmall);
! hr = PyCom_HandlePythonFailureToCOM();
! }
! Py_DECREF(result);
! printf("hresult is %x\n", hr);
! return hr;
}
STDMETHODIMP PyGExtractIcon::GetIconLocation(
/* [unique][in] */ UINT uFlags,
! /* [unique][out] */ LPTSTR szIconFile,
/* [unique][in] */ UINT cchMax,
/* [unique][out] */ LPINT piIndex,
***************
*** 130,133 ****
--- 135,142 ----
{
PY_GATEWAY_METHOD;
+ if (cchMax && szIconFile)
+ szIconFile[0] = 0;
+ *piIndex = 0;
+ *pflags = 0;
PyObject *result;
HRESULT hr=InvokeViaPolicy("GetIconLocation", &result, "i", uFlags);
***************
*** 135,145 ****
PyObject *obFileName;
// Process the Python results, and convert back to the real params
! if (result==Py_None)
! hr = S_FALSE;
else {
if (PyArg_ParseTuple(result, "Oii", &obFileName, piIndex, pflags)) {
TCHAR *filename;
if (PyWinObject_AsTCHAR(obFileName, &filename)) {
! _tcsncpy(filename, szIconFile, cchMax);
PyWinObject_FreeTCHAR(filename);
}
--- 144,159 ----
PyObject *obFileName;
// Process the Python results, and convert back to the real params
! if (PyInt_Check(result) || PyLong_Check(result))
! hr = PyInt_AsLong(result);
else {
if (PyArg_ParseTuple(result, "Oii", &obFileName, piIndex, pflags)) {
TCHAR *filename;
if (PyWinObject_AsTCHAR(obFileName, &filename)) {
! #ifdef UNICODE
! // WTF - _tcsncpy resolving to strncpy?!
! wcsncpy(szIconFile, filename, cchMax);
! #else
! _tcsncpy(szIconFile, filename, cchMax);
! #endif
PyWinObject_FreeTCHAR(filename);
}
Index: PyIExtractIcon.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIExtractIcon.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PyIExtractIcon.h 6 Oct 2003 12:47:57 -0000 1.1
--- PyIExtractIcon.h 7 Oct 2003 02:32:11 -0000 1.2
***************
*** 34,38 ****
// IExtractIcon
STDMETHOD(Extract)(
! LPCSTR pszFile,
UINT nIconIndex,
HICON * phiconLarge,
--- 34,38 ----
// IExtractIcon
STDMETHOD(Extract)(
! LPCTSTR pszFile,
UINT nIconIndex,
HICON * phiconLarge,
***************
*** 42,46 ****
STDMETHOD(GetIconLocation)(
UINT uFlags,
! LPSTR szIconFile,
UINT cchMax,
LPINT piIndex,
--- 42,46 ----
STDMETHOD(GetIconLocation)(
UINT uFlags,
! LPTSTR szIconFile,
UINT cchMax,
LPINT piIndex,
|
|
From: <mha...@us...> - 2003-10-07 02:31:19
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src
In directory sc8-pr-cvs1:/tmp/cvs-serv1960
Modified Files:
shell.cpp PyIShellLink.cpp
Log Message:
Make unicode aware (but still built as ansi)
Index: shell.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** shell.cpp 6 Oct 2003 12:47:57 -0000 1.6
--- shell.cpp 7 Oct 2003 02:31:08 -0000 1.7
***************
*** 256,260 ****
// WIN32_FIND_DATA implementation.
// NOTE: Cloned from win32api.cpp
! PyObject *PyObject_FromWIN32_FIND_DATA(WIN32_FIND_DATAA &findData)
{
PyObject *obCreateTime = PyWinObject_FromFILETIME(findData.ftCreationTime);
--- 256,260 ----
// WIN32_FIND_DATA implementation.
// NOTE: Cloned from win32api.cpp
! PyObject *PyObject_FromWIN32_FIND_DATA(WIN32_FIND_DATA &findData)
{
PyObject *obCreateTime = PyWinObject_FromFILETIME(findData.ftCreationTime);
***************
*** 264,268 ****
return NULL;
! PyObject *ret = Py_BuildValue("lOOOllllss",
// @rdesc The return value is a list of tuples, in the same format as the WIN32_FIND_DATA structure:
findData.dwFileAttributes, // @tupleitem 0|int|attributes|File Attributes. A combination of the win32com.FILE_ATTRIBUTE_* flags.
--- 264,268 ----
return NULL;
! PyObject *ret = Py_BuildValue("lOOOllllNN",
// @rdesc The return value is a list of tuples, in the same format as the WIN32_FIND_DATA structure:
findData.dwFileAttributes, // @tupleitem 0|int|attributes|File Attributes. A combination of the win32com.FILE_ATTRIBUTE_* flags.
***************
*** 274,279 ****
findData.dwReserved0, // @tupleitem 6|int|reserved0|Reserved.
findData.dwReserved1, // @tupleitem 7|int|reserved1|Reserved.
! findData.cFileName, // @tupleitem 8|string|fileName|The name of the file.
! findData.cAlternateFileName ); // @tupleitem 9|string|alternateFilename|Alternative name of the file, expressed in 8.3 format.
Py_DECREF(obCreateTime);
Py_DECREF(obAccessTime);
--- 274,279 ----
findData.dwReserved0, // @tupleitem 6|int|reserved0|Reserved.
findData.dwReserved1, // @tupleitem 7|int|reserved1|Reserved.
! PyWinObject_FromTCHAR(findData.cFileName), // @tupleitem 8|string|fileName|The name of the file.
! PyWinObject_FromTCHAR(findData.cAlternateFileName) ); // @tupleitem 9|string|alternateFilename|Alternative name of the file, expressed in 8.3 format.
Py_DECREF(obCreateTime);
Py_DECREF(obAccessTime);
***************
*** 346,350 ****
static PyObject *PySHGetPathFromIDList(PyObject *self, PyObject *args)
{
! char buffer[MAX_PATH];
PyObject *rc;
LPITEMIDLIST pidl;
--- 346,350 ----
static PyObject *PySHGetPathFromIDList(PyObject *self, PyObject *args)
{
! TCHAR buffer[MAX_PATH];
PyObject *rc;
LPITEMIDLIST pidl;
***************
*** 387,391 ****
// will be raised. If the function fails, a COM Exception with
// HRESULT=E_FAIL will be raised.
! HMODULE hmod = GetModuleHandle("shell32.dll");
PFNSHGetSpecialFolderPath pfnSHGetSpecialFolderPath = (PFNSHGetSpecialFolderPath)GetProcAddress(hmod, "SHGetSpecialFolderPathW");
if (pfnSHGetSpecialFolderPath==NULL)
--- 387,391 ----
// will be raised. If the function fails, a COM Exception with
// HRESULT=E_FAIL will be raised.
! HMODULE hmod = GetModuleHandle(TEXT("shell32.dll"));
PFNSHGetSpecialFolderPath pfnSHGetSpecialFolderPath = (PFNSHGetSpecialFolderPath)GetProcAddress(hmod, "SHGetSpecialFolderPathW");
if (pfnSHGetSpecialFolderPath==NULL)
***************
*** 443,447 ****
// @comm This method is only available if you have shfolder.dll installed, included with certain shell updates.
! HMODULE hmod = LoadLibrary("shfolder.dll");
PFNSHGetFolderPath pfnSHGetFolderPath = NULL;
if (hmod) pfnSHGetFolderPath=(PFNSHGetFolderPath)GetProcAddress(hmod, "SHGetFolderPathW");
--- 443,447 ----
// @comm This method is only available if you have shfolder.dll installed, included with certain shell updates.
! HMODULE hmod = LoadLibrary(TEXT("shfolder.dll"));
PFNSHGetFolderPath pfnSHGetFolderPath = NULL;
if (hmod) pfnSHGetFolderPath=(PFNSHGetFolderPath)GetProcAddress(hmod, "SHGetFolderPathW");
***************
*** 486,490 ****
// @comm This method is only available if you have a late version of shfolder.dll installed, included with certain shell updates.
! HMODULE hmod = LoadLibrary("shfolder.dll");
PFNSHGetFolderLocation pfnSHGetFolderLocation = NULL;
if (hmod) pfnSHGetFolderLocation=(PFNSHGetFolderLocation)GetProcAddress(hmod, "SHGetFolderLocationW");
--- 486,490 ----
// @comm This method is only available if you have a late version of shfolder.dll installed, included with certain shell updates.
! HMODULE hmod = LoadLibrary(TEXT("shfolder.dll"));
PFNSHGetFolderLocation pfnSHGetFolderLocation = NULL;
if (hmod) pfnSHGetFolderLocation=(PFNSHGetFolderLocation)GetProcAddress(hmod, "SHGetFolderLocationW");
***************
*** 535,539 ****
typedef HRESULT (* PFNSHEmptyRecycleBin)(HWND, LPSTR, DWORD );
// @comm This method is only available in shell version 4.71. If the function is not available, a COM Exception with HRESULT=E_NOTIMPL will be raised.
! HMODULE hmod = GetModuleHandle("shell32.dll");
PFNSHEmptyRecycleBin pfnSHEmptyRecycleBin = (PFNSHEmptyRecycleBin)GetProcAddress(hmod, "SHEmptyRecycleBinA");
if (pfnSHEmptyRecycleBin==NULL)
--- 535,539 ----
typedef HRESULT (* PFNSHEmptyRecycleBin)(HWND, LPSTR, DWORD );
// @comm This method is only available in shell version 4.71. If the function is not available, a COM Exception with HRESULT=E_NOTIMPL will be raised.
! HMODULE hmod = GetModuleHandle(TEXT("shell32.dll"));
PFNSHEmptyRecycleBin pfnSHEmptyRecycleBin = (PFNSHEmptyRecycleBin)GetProcAddress(hmod, "SHEmptyRecycleBinA");
if (pfnSHEmptyRecycleBin==NULL)
***************
*** 566,574 ****
static PyObject *PySHUpdateImage(PyObject *self, PyObject *args)
{
! char *szHash;
UINT flags;
int index, imageIndex;
! if(!PyArg_ParseTuple(args, "siii:SHUpdateImage",
! &szHash,
&index,
&flags,
--- 566,574 ----
static PyObject *PySHUpdateImage(PyObject *self, PyObject *args)
{
! PyObject *obHash;
UINT flags;
int index, imageIndex;
! if(!PyArg_ParseTuple(args, "Oiii:SHUpdateImage",
! &obHash,
&index,
&flags,
***************
*** 576,582 ****
--- 576,586 ----
return NULL;
+ TCHAR *szHash;
+ if (!PyWinObject_AsTCHAR(obHash, &szHash))
+ return NULL;
PY_INTERFACE_PRECALL;
SHUpdateImage(szHash, index, flags, imageIndex);
PY_INTERFACE_POSTCALL;
+ PyWinObject_FreeTCHAR(szHash);
Py_INCREF(Py_None);
return Py_None;
Index: PyIShellLink.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellLink.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PyIShellLink.cpp 6 Oct 2003 12:47:57 -0000 1.4
--- PyIShellLink.cpp 7 Oct 2003 02:31:08 -0000 1.5
***************
*** 6,10 ****
! PyObject *PyObject_FromWIN32_FIND_DATA(WIN32_FIND_DATAA &findData);
--- 6,10 ----
! PyObject *PyObject_FromWIN32_FIND_DATA(WIN32_FIND_DATA &findData);
***************
*** 35,39 ****
if ( pISL == NULL )
return NULL;
! WIN32_FIND_DATAA fd;
// @pyparm int|fFlags||One of the following values:
// @flagh Value|Description
--- 35,39 ----
if ( pISL == NULL )
return NULL;
! WIN32_FIND_DATA fd;
// @pyparm int|fFlags||One of the following values:
// @flagh Value|Description
***************
*** 47,51 ****
return NULL;
HRESULT hr;
! char *pszFile = (char *)malloc(cchMaxPath);
if (pszFile==NULL) {
PyErr_SetString(PyExc_MemoryError, "allocating string buffer");
--- 47,51 ----
return NULL;
HRESULT hr;
! TCHAR *pszFile = (TCHAR *)malloc(cchMaxPath * sizeof(TCHAR));
if (pszFile==NULL) {
PyErr_SetString(PyExc_MemoryError, "allocating string buffer");
***************
*** 61,66 ****
}
PyObject *obFD = PyObject_FromWIN32_FIND_DATA(fd);
! PyObject *ret = Py_BuildValue("sO", pszFile, obFD);
! Py_XDECREF(obFD);
free(pszFile);
return ret;
--- 61,66 ----
}
PyObject *obFD = PyObject_FromWIN32_FIND_DATA(fd);
! PyObject *obFile = PyWinObject_FromTCHAR(pszFile);
! PyObject *ret = Py_BuildValue("NN", obFile, obFD);
free(pszFile);
return ret;
***************
*** 123,127 ****
return NULL;
HRESULT hr;
! char *pszName = (char *)malloc(cchMaxName * sizeof(char) );
if (pszName==NULL) {
PyErr_SetString(PyExc_MemoryError, "allocating string buffer");
--- 123,127 ----
return NULL;
HRESULT hr;
! TCHAR *pszName = (TCHAR *)malloc(cchMaxName * sizeof(TCHAR) );
if (pszName==NULL) {
PyErr_SetString(PyExc_MemoryError, "allocating string buffer");
***************
*** 136,140 ****
ret = OleSetOleError(hr);
else
! ret = PyString_FromString(pszName);
free(pszName);
return ret;
--- 136,140 ----
ret = OleSetOleError(hr);
else
! ret = PyWinObject_FromTCHAR(pszName);
free(pszName);
return ret;
***************
*** 147,152 ****
if ( pISL == NULL )
return NULL;
! char *pszName;
! if ( !PyArg_ParseTuple(args, "s:SetDescription", &pszName) )
return NULL;
HRESULT hr;
--- 147,155 ----
if ( pISL == NULL )
return NULL;
! PyObject *obName;
! if ( !PyArg_ParseTuple(args, "O:SetDescription", &obName) )
! return NULL;
! TCHAR *pszName;
! if (!PyWinObject_AsTCHAR(obName, &pszName))
return NULL;
HRESULT hr;
***************
*** 154,157 ****
--- 157,161 ----
hr = pISL->SetDescription( pszName );
PY_INTERFACE_POSTCALL;
+ PyWinObject_FreeTCHAR(pszName);
if ( FAILED(hr) )
***************
*** 172,176 ****
return NULL;
HRESULT hr;
! char *pszName = (char *)malloc(cchMaxName * sizeof(char) );
if (pszName==NULL) {
PyErr_SetString(PyExc_MemoryError, "allocating string buffer");
--- 176,180 ----
return NULL;
HRESULT hr;
! TCHAR *pszName = (TCHAR *)malloc(cchMaxName * sizeof(TCHAR) );
if (pszName==NULL) {
PyErr_SetString(PyExc_MemoryError, "allocating string buffer");
***************
*** 185,189 ****
ret = OleSetOleError(hr);
else
! ret = PyString_FromString(pszName);
free(pszName);
return ret;
--- 189,193 ----
ret = OleSetOleError(hr);
else
! ret = PyWinObject_FromTCHAR(pszName);
free(pszName);
return ret;
***************
*** 196,206 ****
if ( pISL == NULL )
return NULL;
! LPCSTR pszDir;
! if ( !PyArg_ParseTuple(args, "s:SetWorkingDirectory", &pszDir) )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
! hr = pISL->SetWorkingDirectory( pszDir );
PY_INTERFACE_POSTCALL;
if ( FAILED(hr) )
--- 200,214 ----
if ( pISL == NULL )
return NULL;
! PyObject *obName;
! if ( !PyArg_ParseTuple(args, "O:SetWorkingDirectory", &obName) )
! return NULL;
! TCHAR *pszName;
! if (!PyWinObject_AsTCHAR(obName, &pszName))
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
! hr = pISL->SetWorkingDirectory( pszName );
PY_INTERFACE_POSTCALL;
+ PyWinObject_FreeTCHAR(pszName);
if ( FAILED(hr) )
***************
*** 222,226 ****
return NULL;
HRESULT hr;
! char *pszName = (char *)malloc(cchMaxName * sizeof(char) );
if (pszName==NULL) {
PyErr_SetString(PyExc_MemoryError, "allocating string buffer");
--- 230,234 ----
return NULL;
HRESULT hr;
! TCHAR *pszName = (TCHAR *)malloc(cchMaxName * sizeof(TCHAR) );
if (pszName==NULL) {
PyErr_SetString(PyExc_MemoryError, "allocating string buffer");
***************
*** 235,239 ****
ret = OleSetOleError(hr);
else
! ret = PyString_FromString(pszName);
free(pszName);
return ret;
--- 243,247 ----
ret = OleSetOleError(hr);
else
! ret = PyWinObject_FromTCHAR(pszName);
free(pszName);
return ret;
***************
*** 246,252 ****
if ( pISL == NULL )
return NULL;
! LPCSTR pszArgs;
// @pyparm string|args||The new arguments.
! if ( !PyArg_ParseTuple(args, "s:SetArguments", &pszArgs) )
return NULL;
HRESULT hr;
--- 254,263 ----
if ( pISL == NULL )
return NULL;
! PyObject *obArgs;
// @pyparm string|args||The new arguments.
! if ( !PyArg_ParseTuple(args, "O:SetArguments", &obArgs) )
! return NULL;
! TCHAR *pszArgs;
! if (!PyWinObject_AsTCHAR(obArgs, &pszArgs))
return NULL;
HRESULT hr;
***************
*** 254,257 ****
--- 265,269 ----
hr = pISL->SetArguments( pszArgs );
PY_INTERFACE_POSTCALL;
+ PyWinObject_FreeTCHAR(pszArgs);
if ( FAILED(hr) )
***************
*** 356,360 ****
if ( !PyArg_ParseTuple(args, "|i:GetIconLocation", &cchIconPath) )
return NULL;
! char *pszIconPath = (char *)malloc(cchIconPath * sizeof(char) );
if (pszIconPath==NULL) {
PyErr_SetString(PyExc_MemoryError, "allocating string buffer");
--- 368,372 ----
if ( !PyArg_ParseTuple(args, "|i:GetIconLocation", &cchIconPath) )
return NULL;
! TCHAR *pszIconPath = (TCHAR *)malloc(cchIconPath * sizeof(TCHAR) );
if (pszIconPath==NULL) {
PyErr_SetString(PyExc_MemoryError, "allocating string buffer");
***************
*** 371,375 ****
ret = OleSetOleError(hr);
else
! ret = Py_BuildValue("si", pszIconPath, iIcon);
free(pszIconPath);
return ret;
--- 383,387 ----
ret = OleSetOleError(hr);
else
! ret = Py_BuildValue("Ni", PyWinObject_FromTCHAR(pszIconPath), iIcon);
free(pszIconPath);
return ret;
***************
*** 382,390 ****
if ( pISL == NULL )
return NULL;
! LPCSTR pszIconPath;
// @pyparm string|iconPath||Path to the file with the icon.
// @pyparm int|iIcon||Index of the icon.
int iIcon;
! if ( !PyArg_ParseTuple(args, "si:SetIconLocation", &pszIconPath, &iIcon) )
return NULL;
HRESULT hr;
--- 394,405 ----
if ( pISL == NULL )
return NULL;
! PyObject *obIconPath;
// @pyparm string|iconPath||Path to the file with the icon.
// @pyparm int|iIcon||Index of the icon.
int iIcon;
! if ( !PyArg_ParseTuple(args, "Oi:SetIconLocation", &obIconPath, &iIcon) )
! return NULL;
! TCHAR *pszIconPath;
! if (!PyWinObject_AsTCHAR(obIconPath, &pszIconPath))
return NULL;
HRESULT hr;
***************
*** 392,395 ****
--- 407,411 ----
hr = pISL->SetIconLocation( pszIconPath, iIcon );
PY_INTERFACE_POSTCALL;
+ PyWinObject_FreeTCHAR(pszIconPath);
if ( FAILED(hr) )
***************
*** 406,414 ****
if ( pISL == NULL )
return NULL;
! LPCSTR pszPathRel;
// @pyparm string|relPath||The relative path.
// @pyparm int|reserved|0|Reserved - must be zero.
DWORD dwReserved = 0;
! if ( !PyArg_ParseTuple(args, "s|l:SetRelativePath", &pszPathRel, &dwReserved) )
return NULL;
HRESULT hr;
--- 422,433 ----
if ( pISL == NULL )
return NULL;
! PyObject *obPathRel;
// @pyparm string|relPath||The relative path.
// @pyparm int|reserved|0|Reserved - must be zero.
DWORD dwReserved = 0;
! if ( !PyArg_ParseTuple(args, "O|l:SetRelativePath", &obPathRel, &dwReserved) )
! return NULL;
! TCHAR *pszPathRel;
! if (!PyWinObject_AsTCHAR(obPathRel, &pszPathRel))
return NULL;
HRESULT hr;
***************
*** 416,419 ****
--- 435,439 ----
hr = pISL->SetRelativePath( pszPathRel, dwReserved );
PY_INTERFACE_POSTCALL;
+ PyWinObject_FreeTCHAR(pszPathRel);
if ( FAILED(hr) )
***************
*** 475,485 ****
if ( pISL == NULL )
return NULL;
! LPCSTR pszFile;
! // @pyparm string|path||The path and filename of the link.
! if ( !PyArg_ParseTuple(args, "s:SetPath", &pszFile) )
return NULL;
HRESULT hr;
PY_INTERFACE_PRECALL;
! hr = pISL->SetPath( pszFile );
PY_INTERFACE_POSTCALL;
--- 495,508 ----
if ( pISL == NULL )
return NULL;
! PyObject *obName;
! if ( !PyArg_ParseTuple(args, "O:SetDescription", &obName) )
return NULL;
+ TCHAR *pszName;
+ if (!PyWinObject_AsTCHAR(obName, &pszName))
+ return NULL;
+ // @pyparm string|path||The path and filename of the link.
HRESULT hr;
PY_INTERFACE_PRECALL;
! hr = pISL->SetPath( pszName );
PY_INTERFACE_POSTCALL;
|
|
From: <mha...@us...> - 2003-10-06 13:41:00
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers
In directory sc8-pr-cvs1:/tmp/cvs-serv2715
Modified Files:
context_menu.py
Log Message:
Remove unused interfaces.
Index: context_menu.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/demos/servers/context_menu.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** context_menu.py 6 Oct 2003 12:53:12 -0000 1.1
--- context_menu.py 6 Oct 2003 13:40:09 -0000 1.2
***************
*** 21,25 ****
_reg_desc_ = "Python Sample Shell Extension (context menu)"
_reg_clsid_ = "{CED0336C-C9EE-4a7f-8D7F-C660393C381F}"
! _com_interfaces_ = [shell.IID_IShellExtInit, shell.IID_IContextMenu, shell.IID_IExtractIcon, pythoncom.IID_IPersistFile]
_public_methods_ = IContextMenu_Methods + IShellExtInit_Methods
--- 21,25 ----
_reg_desc_ = "Python Sample Shell Extension (context menu)"
_reg_clsid_ = "{CED0336C-C9EE-4a7f-8D7F-C660393C381F}"
! _com_interfaces_ = [shell.IID_IShellExtInit, shell.IID_IContextMenu]
_public_methods_ = IContextMenu_Methods + IShellExtInit_Methods
|
|
From: <mha...@us...> - 2003-10-06 13:30:30
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory sc8-pr-cvs1:/tmp/cvs-serv1264/Pythonwin/pywin/framework Modified Files: help.py Log Message: Add URL pointed to by Tom Heller on the HTMLHelp issue. Index: help.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/help.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** help.py 6 Oct 2003 13:28:44 -0000 1.8 --- help.py 6 Oct 2003 13:30:26 -0000 1.9 *************** *** 40,43 **** --- 40,45 ---- # so we disable it, forcing ShellExecute, which works fine (but # doesn't close the help file when Pythonwin is closed. + # Tom Heller also points out http://www.microsoft.com/mind/0499/faq/faq0499.asp, + # which may or may not be related. elif 0 and ext == ".chm": import win32help |
|
From: <mha...@us...> - 2003-10-06 13:28:48
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory sc8-pr-cvs1:/tmp/cvs-serv812/Pythonwin/pywin/framework Modified Files: help.py Log Message: Using the htmlhelp API wreaks havoc with keyboard shortcuts so we disable it, forcing ShellExecute, which works fine (but doesn't close the help file when Pythonwin is closed.) Index: help.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/help.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** help.py 3 Jul 2003 03:49:38 -0000 1.7 --- help.py 6 Oct 2003 13:28:44 -0000 1.8 *************** *** 37,41 **** if ext == ".hlp": win32api.WinHelp( win32ui.GetMainFrame().GetSafeHwnd(), fileName, helpCmd, helpArg) ! elif ext == ".chm": import win32help global htmlhelp_handle --- 37,44 ---- if ext == ".hlp": win32api.WinHelp( win32ui.GetMainFrame().GetSafeHwnd(), fileName, helpCmd, helpArg) ! # XXX - using the htmlhelp API wreaks havoc with keyboard shortcuts ! # so we disable it, forcing ShellExecute, which works fine (but ! # doesn't close the help file when Pythonwin is closed. ! elif 0 and ext == ".chm": import win32help global htmlhelp_handle |
|
From: <mha...@us...> - 2003-10-06 13:16:43
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger In directory sc8-pr-cvs1:/tmp/cvs-serv30812/Pythonwin/pywin/debugger Modified Files: debugger.py Log Message: Fix attribute error when trying to start debugger. Index: debugger.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/debugger.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** debugger.py 18 Dec 2002 05:21:30 -0000 1.10 --- debugger.py 6 Oct 2003 13:16:39 -0000 1.11 *************** *** 425,428 **** --- 425,429 ---- self.last_cmd_debugged = "" self.abortClosed = 0 + self.isInitialBreakpoint = 0 debugger_parent.__init__(self) *************** *** 933,935 **** def _doexec(cmd, globals, locals): ! exec cmd in globals, locals \ No newline at end of file --- 934,936 ---- def _doexec(cmd, globals, locals): ! exec cmd in globals, locals |
|
From: <mha...@us...> - 2003-10-06 13:12:50
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1:/tmp/cvs-serv30079 Modified Files: gencache.py Log Message: Remove old, unused code. Index: gencache.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/gencache.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** gencache.py 16 Sep 2003 04:55:27 -0000 1.21 --- gencache.py 6 Oct 2003 13:12:46 -0000 1.22 *************** *** 232,256 **** modName = GetGeneratedFileName(typelibCLSID, lcid, major, minor) return _GetModule(modName) - ############## - typelibCLSID = str(typelibCLSID) - args = typelibCLSID, lcid, major, minor - args = versionRedirectMap.get(args, args) - modName = GetGeneratedFileName(*args) - try: - return _GetModule(modName) - except ImportError: - # See if we can find a module with a different minor version. - items = [] - for desc in GetGeneratedInfos(): - if str(desc[0])==typelibCLSID and desc[1]==lcid and desc[2]==major: - items.append(desc) - if not items: - raise - # Items are all identical, except for last tuple element - # We want the latest minor version we have - so just sort and grab last - items.sort() - new_minor = items[-1][3] - versionRedirectMap[args] = typelibCLSID, lcid, major, new_minor - return GetModuleForTypelib(typelibCLSID, lcid, major, new_minor) def MakeModuleForTypelib(typelibCLSID, lcid, major, minor, progressInstance = None, bGUIProgress = None, bForDemand = bForDemandDefault, bBuildHidden = 1): --- 232,235 ---- |
|
From: <mha...@us...> - 2003-10-06 13:11:39
|
Update of /cvsroot/pywin32/pywin32/com/win32com/server
In directory sc8-pr-cvs1:/tmp/cvs-serv29725
Modified Files:
register.py
Log Message:
Most registration functions now take optional keyword arguments
'finalize_register' and 'finalize_unregister' - both functions which are
called at the end of the registration/unregistration process.
Index: register.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/server/register.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** register.py 26 Jul 2003 14:12:12 -0000 1.15
--- register.py 6 Oct 2003 13:11:36 -0000 1.16
***************
*** 413,416 ****
--- 413,419 ----
if not quiet:
print 'Registered type library:', tlb_filename
+ extra = flags.get('finalize_register')
+ if extra:
+ extra()
def UnregisterClasses(*classes, **flags):
***************
*** 440,443 ****
--- 443,450 ----
except pythoncom.com_error:
pass
+
+ extra = flags.get('finalize_unregister')
+ if extra:
+ extra()
#
# Unregister info is for installers or external uninstallers.
|
|
From: <mha...@us...> - 2003-10-06 13:09:51
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src
In directory sc8-pr-cvs1:/tmp/cvs-serv29361
Modified Files:
MiscTypes.cpp PyIBase.cpp
Log Message:
Allow the PyIEnum* interfaces to act as iterators. Only the new
win32com.shell.shell interfaces take advantage of this.
Index: MiscTypes.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/MiscTypes.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MiscTypes.cpp 1 Sep 1999 23:02:42 -0000 1.1
--- MiscTypes.cpp 6 Oct 2003 13:09:44 -0000 1.2
***************
*** 27,35 ****
0, /*tp_call*/
0, /*tp_str*/
! 0, /*tp_xxx1*/
! 0, /*tp_xxx2*/
! 0, /*tp_xxx3*/
! 0, /*tp_xxx4*/
! "Define the behavior of a PythonCOM Interface type.",
};
--- 27,35 ----
0, /*tp_call*/
0, /*tp_str*/
! 0, /*tp_getattro */
! 0, /*tp_setattro */
! 0, /* tp_as_buffer */
! 0, /* tp_flags */
! "Define the behavior of a PythonCOM Interface type.", /* tp_doc */
};
***************
*** 53,56 ****
--- 53,72 ----
(reprfunc)PyIBase::repr, /*tp_repr*/
0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro */
+ 0, /*tp_setattro */
+ 0, /* tp_as_buffer */
+ Py_TPFLAGS_HAVE_ITER, /* tp_flags */
+ 0, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
+ 0, /* tp_weaklistoffset */
+ PyIBase::iter, /* tp_iter */
+ PyIBase::iternext /* tp_iternext */
};
Index: PyIBase.cpp
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyIBase.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PyIBase.cpp 1 Sep 1999 23:02:42 -0000 1.1
--- PyIBase.cpp 6 Oct 2003 13:09:44 -0000 1.2
***************
*** 40,43 ****
--- 40,56 ----
return Py_FindMethodInChain(&((PyComTypeObject *)ob_type)->chain, this, name);
}
+ PyObject *
+ PyIBase::iter()
+ {
+ return PyErr_Format(PyExc_TypeError,
+ "COM objects of type '%s' can not be iterated.", ob_type->tp_name);
+ return NULL;
+ }
+ PyObject *
+ PyIBase::iternext()
+ {
+ PyErr_SetString(PyExc_RuntimeError, "not iterable");
+ return NULL;
+ }
/*static*/int PyIBase::setattr(PyObject *op, char *name, PyObject *v)
***************
*** 74,76 ****
--- 87,99 ----
{
return ((PyIBase *)ob1)->compare(ob2);
+ }
+
+ /*static*/ PyObject *PyIBase::iter(PyObject *self)
+ {
+ return ((PyIBase *)self)->iter();
+ }
+
+ /*static*/ PyObject *PyIBase::iternext(PyObject *self)
+ {
+ return ((PyIBase *)self)->iternext();
}
|
|
From: <mha...@us...> - 2003-10-06 13:09:51
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include
In directory sc8-pr-cvs1:/tmp/cvs-serv29361/include
Modified Files:
PythonCOM.h
Log Message:
Allow the PyIEnum* interfaces to act as iterators. Only the new
win32com.shell.shell interfaces take advantage of this.
Index: PythonCOM.h
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PythonCOM.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** PythonCOM.h 20 Jan 2003 23:19:14 -0000 1.9
--- PythonCOM.h 6 Oct 2003 13:09:44 -0000 1.10
***************
*** 165,168 ****
--- 165,170 ----
virtual PyObject *repr();
virtual int compare(PyObject *other) {return (int)this-int(other);}
+ virtual PyObject *iter();
+ virtual PyObject *iternext();
static struct PyMethodDef PyIBase::empty_methods[];
***************
*** 179,183 ****
static int setattr(PyObject *op, char *name, PyObject *v);
static int cmp(PyObject *ob1, PyObject *ob2);
!
};
--- 181,186 ----
static int setattr(PyObject *op, char *name, PyObject *v);
static int cmp(PyObject *ob1, PyObject *ob2);
! static PyObject *iter(PyObject *self);
! static PyObject *iternext(PyObject *self);
};
|
|
From: <mha...@us...> - 2003-10-06 13:07:08
|
Update of /cvsroot/pywin32/pywin32/com/win32com/makegw
In directory sc8-pr-cvs1:/tmp/cvs-serv28862
Modified Files:
__init__.py makegw.py makegwparse.py
Log Message:
A number of changes on the road to the shell enhancements.
Index: __init__.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/makegw/__init__.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** __init__.py 1 Sep 1999 23:00:45 -0000 1.1
--- __init__.py 6 Oct 2003 13:07:02 -0000 1.2
***************
*** 0 ****
--- 1 ----
+ # indicates a python package.
Index: makegw.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/makegw/makegw.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** makegw.py 28 Nov 1999 12:41:12 -0000 1.6
--- makegw.py 6 Oct 2003 13:07:02 -0000 1.7
***************
*** 90,100 ****
// Generated by makegw.py
! #include "stdafx.h"
! #include "PythonCOM.h"
''' % (interface.name, desc))
! if bMakeGateway:
! fout.write('#include "PythonCOMServer.h"\n')
! if interface.base not in ["IUnknown", "IDispatch"]:
! fout.write('#include "Py%s.h"\n' % interface.base)
fout.write('#include "Py%s.h"\n\n// @doc - This file contains autoduck documentation\n' % interface.name)
if bMakeInterface: ifc_cpp_writer(fout, interface)
--- 90,99 ----
// Generated by makegw.py
! #include "shell_pch.h"
''' % (interface.name, desc))
! # if bMakeGateway:
! # fout.write('#include "PythonCOMServer.h"\n')
! # if interface.base not in ["IUnknown", "IDispatch"]:
! # fout.write('#include "Py%s.h"\n' % interface.base)
fout.write('#include "Py%s.h"\n\n// @doc - This file contains autoduck documentation\n' % interface.name)
if bMakeInterface: ifc_cpp_writer(fout, interface)
***************
*** 186,190 ****
return NULL;
''' % strdict)
! argsParseTuple = argsCOM = formatChars = codePost = codePobjects = codeCobjects = cleanup = ""
needConversion = 0
# if method.name=="Stat": import win32dbg;win32dbg.brk()
--- 185,190 ----
return NULL;
''' % strdict)
! argsParseTuple = argsCOM = formatChars = codePost = \
! codePobjects = codeCobjects = cleanup = cleanup_gil = ""
needConversion = 0
# if method.name=="Stat": import win32dbg;win32dbg.brk()
***************
*** 202,205 ****
--- 202,206 ----
needConversion = needConversion or argCvt.NeedUSES_CONVERSION()
cleanup = cleanup + argCvt.GetInterfaceArgCleanup()
+ cleanup_gil = cleanup_gil + argCvt.GetInterfaceArgCleanupGIL()
comArgName, comArgDeclString = argCvt.GetInterfaceCppObjectInfo()
if comArgDeclString: # If we should declare a variable
***************
*** 210,213 ****
--- 211,215 ----
f.write('\t%s %s;\n\tPyObject *ob%s;\n' % (arg.type, arg.name, arg.name))
+ f.write('\t// @pyparm <o Py%s>|%s||Description for %s\n' % (arg.type, arg.name, arg.name))
codePost = codePost + '\tif (bPythonIsHappy && !PyObject_As%s( ob%s, &%s )) bPythonIsHappy = FALSE;\n' % (arg.type, arg.name, arg.name)
***************
*** 216,219 ****
--- 218,222 ----
argsCOM = argsCOM + ", " + arg.name
+ cleanup = cleanup + "\tPyObject_Free%s(%s);\n" % (arg.type, arg.name)
if needConversion: f.write("\tUSES_CONVERSION;\n")
***************
*** 227,230 ****
--- 230,234 ----
strdict['argsCOM'] = argsCOM[1:]
strdict['cleanup'] = cleanup
+ strdict['cleanup_gil'] = cleanup_gil
f.write(\
''' HRESULT hr;
***************
*** 233,236 ****
--- 237,241 ----
%(cleanup)s
PY_INTERFACE_POSTCALL;
+ %(cleanup_gil)s
if ( FAILED(hr) )
return PyCom_BuildPyException(hr, p%(ptr)s, IID_%(interfacename)s );
Index: makegwparse.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/makegw/makegwparse.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** makegwparse.py 26 Jul 2003 14:10:49 -0000 1.8
--- makegwparse.py 6 Oct 2003 13:07:02 -0000 1.9
***************
*** 106,109 ****
--- 106,117 ----
return ""
+ def GetInterfaceArgCleanupGIL(self):
+ """Return cleanup code for C++ args passed to the interface
+ method that must be executed with the GIL held"""
+ if DEBUG:
+ return "/* GetInterfaceArgCleanup (GIL held) output goes here: %s */\n" % self.arg.name
+ else:
+ return ""
+
def GetUnconstType(self):
return self.arg.unc_type
***************
*** 253,257 ****
return "<o unicode>"
def GetParsePostCode(self):
! return "\tif (!PyWinObject_AsBstr(ob%s, %s)) bPythonIsHappy = FALSE;\n" % (self.arg.name, self.GetIndirectedArgName(None, 2))
def GetBuildForInterfacePreCode(self):
notdirected = self.GetIndirectedArgName(None, 1)
--- 261,265 ----
return "<o unicode>"
def GetParsePostCode(self):
! return "\tif (bPythonIsHappy && !PyWinObject_AsBstr(ob%s, %s)) bPythonIsHappy = FALSE;\n" % (self.arg.name, self.GetIndirectedArgName(None, 2))
def GetBuildForInterfacePreCode(self):
notdirected = self.GetIndirectedArgName(None, 1)
***************
*** 273,277 ****
return self.arg.unc_type
def GetParsePostCode(self):
! return "\tif (!PyWinObject_AsBstr(ob%s, %s)) bPythonIsHappy = FALSE;\n" % (self.arg.name, self.GetIndirectedArgName(None, 2))
def GetInterfaceArgCleanup(self):
return "\tSysFreeString(%s);\n" % self.GetIndirectedArgName(None, 1)
--- 281,285 ----
return self.arg.unc_type
def GetParsePostCode(self):
! return "\tif (bPythonIsHappy && !PyWinObject_AsBstr(ob%s, %s)) bPythonIsHappy = FALSE;\n" % (self.arg.name, self.GetIndirectedArgName(None, 2))
def GetInterfaceArgCleanup(self):
return "\tSysFreeString(%s);\n" % self.GetIndirectedArgName(None, 1)
***************
*** 337,340 ****
--- 345,379 ----
return "\tob%s = PyCom_PyObjectFromSTATSTG(%s);\n\t// STATSTG doco says our responsibility to free\n\tif ((%s).pwcsName) CoTaskMemFree((%s).pwcsName);\n" % (self.arg.name, self.GetIndirectedArgName(None, 1),notdirected,notdirected)
+ class ArgFormatterGeneric(ArgFormatterPythonCOM):
+ def _GetPythonTypeDesc(self):
+ return "<o %s>" % self.arg.type
+ def GetParsePostCode(self):
+ return '\tif (!PyObject_As%s(ob%s, &%s) bPythonIsHappy = FALSE;\n' % (self.arg.type, self.arg.name, self.GetIndirectedArgName(None, 1))
+ def GetInterfaceArgCleanup(self):
+ return '\tPyObject_Free%s(%s);\n' % (self.arg.type, self.arg.name)
+ def GetBuildForInterfacePreCode(self):
+ notdirected = self.GetIndirectedArgName(None, 1)
+ return "\tob%s = PyObject_From%s(%s);\n" % (self.arg.name, self.arg.type, self.GetIndirectedArgName(None, 1))
+
+ class ArgFormatterIDLIST(ArgFormatterPythonCOM):
+ def _GetPythonTypeDesc(self):
+ return "<o PyIDL>"
+ def GetParsePostCode(self):
+ return '\tif (bPythonIsHappy && !PyObject_AsPIDL(ob%s, &%s)) bPythonIsHappy = FALSE;\n' % (self.arg.name, self.GetIndirectedArgName(None, 1))
+ def GetInterfaceArgCleanup(self):
+ return '\tPyObject_FreePIDL(%s);\n' % (self.arg.name,)
+ def GetBuildForInterfacePreCode(self):
+ notdirected = self.GetIndirectedArgName(None, 1)
+ return "\tob%s = PyObject_FromPIDL(%s);\n" % (self.arg.name, self.GetIndirectedArgName(None, 1))
+
+ class ArgFormatterHANDLE(ArgFormatterPythonCOM):
+ def _GetPythonTypeDesc(self):
+ return "<o PyHANDLE>"
+ def GetParsePostCode(self):
+ return '\tif (!PyWinObject_AsHANDLE(ob%s, &%s, FALSE) bPythonIsHappy = FALSE;\n' % (self.arg.name, self.GetIndirectedArgName(None, 1))
+ def GetBuildForInterfacePreCode(self):
+ notdirected = self.GetIndirectedArgName(None, 1)
+ return "\tob%s = PyWinObject_FromHANDLE(%s);\n" % (self.arg.name, self.GetIndirectedArgName(None, 0))
+
class ArgFormatterLARGE_INTEGER(ArgFormatterPythonCOM):
def GetKeyName(self):
***************
*** 364,368 ****
# vs. in params for interface mode.
sArg = self.GetIndirectedArgName(1, 2)
! return "\tif (!PyCom_InterfaceFromPyInstanceOrObject(ob%s, IID_%s, (void **)%s, TRUE /* bNoneOK */))\n\t\t bPythonIsHappy = FALSE;\n" % (self.arg.name, self.arg.type, sArg)
def GetBuildForInterfacePreCode(self):
--- 403,407 ----
# vs. in params for interface mode.
sArg = self.GetIndirectedArgName(1, 2)
! return "\tif (bPythonIsHappy && !PyCom_InterfaceFromPyInstanceOrObject(ob%s, IID_%s, (void **)%s, TRUE /* bNoneOK */))\n\t\t bPythonIsHappy = FALSE;\n" % (self.arg.name, self.arg.type, sArg)
def GetBuildForInterfacePreCode(self):
***************
*** 374,378 ****
def GetInterfaceArgCleanup(self):
! return "\tif (%s) %s->Release();" % (self.arg.name, self.arg.name)
class ArgFormatterVARIANT(ArgFormatterPythonCOM):
--- 413,417 ----
def GetInterfaceArgCleanup(self):
! return "\tif (%s) %s->Release();\n" % (self.arg.name, self.arg.name)
class ArgFormatterVARIANT(ArgFormatterPythonCOM):
***************
*** 429,432 ****
--- 468,473 ----
"LPCWSTR": (ArgFormatterOLECHAR, 1, 1),
"LPWSTR": (ArgFormatterOLECHAR, 1, 1),
+ "LPCSTR": (ArgFormatterOLECHAR, 1, 1),
+ "HANDLE": (ArgFormatterHANDLE, 0),
"BSTR": (ArgFormatterBSTR, 1, 0),
"const IID": (ArgFormatterIID, 0),
***************
*** 454,457 ****
--- 495,502 ----
"WORD": (ArgFormatterShort, 0),
"VARIANT_BOOL": (ArgFormatterShort, 0),
+ "HWND": (ArgFormatterShort, 0),
+ "HMENU": (ArgFormatterShort, 0),
+ "HICON": (ArgFormatterShort, 0),
+ "UINT": (ArgFormatterShort, 0),
"Control": (ArgFormatterInterface, 0, 1),
"DataObject": (ArgFormatterInterface, 0, 1),
***************
*** 460,463 ****
--- 505,510 ----
"DataSource": (ArgFormatterInterface, 0, 1),
"DataFormat": (ArgFormatterInterface, 0, 1),
+ "ITEMIDLIST": (ArgFormatterIDLIST, 0, 1),
+ "const ITEMIDLIST": (ArgFormatterIDLIST, 0, 1),
}
***************
*** 562,566 ****
# options ret type callconv name
# ----------------- -------- -------- --------
! regex = regex.compile('virtual \\(/\\*.*\\*/ \\)?\\(.*\\) \\(.*\\) \\(.*\\)( ')
def __init__(self, good_interface_names ):
self.good_interface_names = good_interface_names
--- 609,613 ----
# options ret type callconv name
# ----------------- -------- -------- --------
! regex = regex.compile('virtual \\(/\\*.*\\*/ \\)?\\(.*\\) \\(.*\\) \\(.*\\)(\w?')
def __init__(self, good_interface_names ):
self.good_interface_names = good_interface_names
***************
*** 635,638 ****
--- 682,686 ----
if Interface.regex.search(line, 0) >=0:
name = Interface.regex.group(2)
+ print name
if name==interfaceName:
return Interface()
|
|
From: <mha...@us...> - 2003-10-06 13:06:02
|
Update of /cvsroot/pywin32/pywin32/com
In directory sc8-pr-cvs1:/tmp/cvs-serv28761/com
Modified Files:
pythoncom.py
Log Message:
A directory name with '_d' in it would confuse things!
Index: pythoncom.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/pythoncom.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pythoncom.py 18 Sep 2003 05:32:35 -0000 1.2
--- pythoncom.py 6 Oct 2003 13:05:56 -0000 1.3
***************
*** 4,8 ****
import win32api, imp, sys, os
suffix = ""
! if win32api.__file__.find("_d")>0:
suffix = "_d"
filename = "%s%d%d%s.dll" % (modname, sys.version_info[0], sys.version_info[1], suffix)
--- 4,8 ----
import win32api, imp, sys, os
suffix = ""
! if win32api.__file__.endswith("_d.pyd")>0:
suffix = "_d"
filename = "%s%d%d%s.dll" % (modname, sys.version_info[0], sys.version_info[1], suffix)
|
|
From: <mha...@us...> - 2003-10-06 13:05:14
|
Update of /cvsroot/pywin32/pywin32/win32/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv28613/win32/Lib
Modified Files:
pywintypes.py
Log Message:
A directory name with '_d' in it would confuse things!
Index: pywintypes.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Lib/pywintypes.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pywintypes.py 18 Sep 2003 05:33:13 -0000 1.2
--- pywintypes.py 6 Oct 2003 13:05:10 -0000 1.3
***************
*** 4,8 ****
import win32api, imp, sys, os
suffix = ""
! if win32api.__file__.find("_d")>0:
suffix = "_d"
filename = "%s%d%d%s.dll" % (modname, sys.version_info[0], sys.version_info[1], suffix)
--- 4,8 ----
import win32api, imp, sys, os
suffix = ""
! if win32api.__file__.endswith("_d.pyd")>0:
suffix = "_d"
filename = "%s%d%d%s.dll" % (modname, sys.version_info[0], sys.version_info[1], suffix)
|
|
From: <mha...@us...> - 2003-10-06 13:04:22
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv28508/win32/Lib Modified Files: win32evtlogutil.py Log Message: Add newline to end of file. Index: win32evtlogutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32evtlogutil.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** win32evtlogutil.py 7 Jun 2003 02:06:16 -0000 1.7 --- win32evtlogutil.py 6 Oct 2003 13:04:18 -0000 1.8 *************** *** 148,150 **** map(lambda item, feeder = feeder: apply(feeder, (item,)), objects) finally: ! win32evtlog.CloseEventLog(h) \ No newline at end of file --- 148,150 ---- map(lambda item, feeder = feeder: apply(feeder, (item,)), objects) finally: ! win32evtlog.CloseEventLog(h) |
|
From: <mha...@us...> - 2003-10-06 13:03:46
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv28090/win32/Lib Modified Files: win32pdhutil.py Log Message: Add some comments about "% Processor Time", as many people get confused why it always returns 98% :) (Well, I,m still confused/amazed that it always managed to return exactly 98% in my tests, but I don't think the sample size was enough to be significant! :) Index: win32pdhutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32pdhutil.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** win32pdhutil.py 1 Sep 2003 08:09:50 -0000 1.6 --- win32pdhutil.py 6 Oct 2003 13:03:41 -0000 1.7 *************** *** 42,45 **** --- 42,50 ---- def GetPerformanceAttributes(object, counter, instance = None, inum=-1, format = win32pdh.PDH_FMT_LONG, machine=None): + # NOTE: If you attempt to use this function to get "% Processor Time", + # it will not work as you expect - the problem is that by creating a + # new query each time, we force the CPU to 100%. If you pull this + # function apart, and only do the inner "CollectQueryData" each time + # you need to know, it will give the correct results. path = win32pdh.MakeCounterPath( (machine,object,instance, None, inum,counter) ) hq = win32pdh.OpenQuery() |