Re: [python-win32] Issue with win32evtlog.ReportEvent

2011-04-21 Thread Mark Hammond
better position :) Again, thanks, and I'll check this in over the next week or so... Cheers, Mark On 16/04/2011 2:56 AM, Amaury Forgeot d'Arc wrote: 2011/4/14 Mark Hammond: Sadly some hacks were made to SWIG to support some of the COM objects and the source to those changes were

Re: [python-win32] Fw: [ pywin32-Bugs-3292681 ] adodbapi - Subtle crash

2011-04-28 Thread Mark Hammond
On 29/04/2011 7:07 AM, Vernon Cole wrote: I found two fixes for the crash. Now I need one of you brilliant folks to tell me which is correct. First, here is a snippet from adodbapi. Look closely at the comments on the last three lines of code ... v v v v v v v v v def _closeAdoConnection(sel

Re: [python-win32] DispatchWithEvents

2011-05-03 Thread Mark Hammond
On 3/05/2011 9:15 PM, Michael Illgner wrote: Hi I have got some questions regarding win32com.client.DispatchEventWithEvents() Is there any documentation available for this method? Only the docstring. I am writing a kind for a network proxy for a custom COM api. and I am using a simple socket

Re: [python-win32] DispatchWithEvents

2011-05-03 Thread Mark Hammond
On 4/05/2011 12:39 AM, Michael Illgner wrote: 2011/5/3 Mark Hammond: There is nothing magic about events - you need to provide your own magic :) All the calls are still normal blocking calls - so if you want a model where methods on your com object are done in the background and fire when

Re: [python-win32] DispatchWithEvents

2011-05-04 Thread Mark Hammond
[re-added the mailing list - please keep everything there] On 4/05/2011 6:09 PM, Michael Illgner wrote: 2011/5/4 Mark Hammond: On 4/05/2011 12:39 AM, Michael Illgner wrote: If everything is happening in a free-threaded context though, no message loop is generally required. my server

Re: [python-win32] DispatchWithEvents

2011-05-05 Thread Mark Hammond
On 5/05/2011 5:49 PM, Michael Illgner wrote: I just took a look at the registry, the InprocServer32 key of my COM component has an entry ThreadingModel with value "both". So I if create the COM objects in the main thread and the socket server starts a new thread for every incoming request (socket

Re: [python-win32] Interaction between wxPython and win32ui on Win 7

2011-05-08 Thread Mark Hammond
On 7/05/2011 8:32 PM, Dietmar Schwertberger wrote: > Hi! > > I'm observing some strange interaction between wxPython and win32ui > on Windows 7 PCs. win32ui is built around the MFC framework, so has a fair bit of complications just from that layer. However, just importing win32ui and not creat

Re: [python-win32] Create _reg_clsid?

2011-05-22 Thread Mark Hammond
On 21/05/2011 2:58 AM, Jun Koi wrote: hi, i am trying to create my first context menu shell extension. i base my code on the sample context_menu.py. i have a question: how can i create my "_reg_clsid" for my extension? I think you just want: >>> import pythoncom >>> pythoncom.CreateGuid() IID

Re: [python-win32] OLE COM in Python

2011-05-23 Thread Mark Hammond
On 23/05/2011 7:59 PM, kycbusin...@kycbusiness.com wrote: Dear sir, I am looking for a sample python script to declare VARIANTs similar to one shown below which is for Perl. Your help will be very much appreciated. win32com doesn't have a way to explicitly declare variants - you just pass nor

Re: [python-win32] Error Quitting Excel Instance when One is Already Open

2011-05-24 Thread Mark Hammond
Sadly this is all under the control of Excel, so I've no good advice. The poor advice I can offer is (1) for your own piece of mind, see if you can get the same basic behaviour with wscript and a .vbs script, (2) to try and see if you can find a similar problem in any language/environment (eg,

Re: [python-win32] outlook new mail handling

2011-05-24 Thread Mark Hammond
You should check out the "spambayes" project at sourceforge, and particularly the spambayes\Outlook2000 directory - addin.py and manager.py in particular. Mark On 25/05/2011 5:32 AM, Umesh Sharma wrote: hi, i am building application for outlook in my application i need to capture the NewMailE

Re: [python-win32] OLE COM in Python

2011-05-24 Thread Mark Hammond
in...@kycbusiness.com Sent: Monday, May 23, 2011 9:34:02 PM Subject: Re: [python-win32] OLE COM in Python Dear Dr. Hammond, Thank you very much for your instruction. Sincerely, Kin Cheung - Original Message - From: "Mark Hammond" To: kycbusin...@kycbusiness.com Cc: python-wi

Re: [python-win32] RTD Server problem with Excel 2007 / How to do vtable-call, without IDispatch?

2011-05-25 Thread Mark Hammond
I'm afraid I can't really help, but: On 25/05/2011 8:11 PM, Tobias Oberstein wrote: How can I call on the interface not via IDispatch, but using vtable-based direct call? You can't I'm afraid. However, your "casting" code might be suspect: # Need to "cast" the raw PyIDispatch object to th

Re: [python-win32] pyTTS in versions later than 2.5

2011-05-25 Thread Mark Hammond
On 25/05/2011 8:40 PM, Jacob Kruger wrote: I got hold of pyTTS-3.0.win32-py2.5.exe, but it seems to be like last available version off the sourceforge website - might be able to double check that one when at home, since this machine is a bit slow/unstable when it comes to certain types of web bro

Re: [python-win32] The "right" way to handle permission issues

2011-05-30 Thread Mark Hammond
On 31/05/2011 3:58 AM, Gremlin wrote: Hello, I’m having some trouble with Windows 7 and probably Windows Vista as well. My application runs elevated and has to create files and folders within the “Program Files”-Folder. (I can’t store the files at another place.) I’m using the os module (Python

Re: [python-win32] Excel "stopped working" after reading in sheet names

2011-05-31 Thread Mark Hammond
On 31/05/2011 6:09 PM, Tim Golden wrote: On 30/05/2011 21:26, Mark Mordeca wrote: Greetings, I would appreciate any help I could get with the following problem. 30% of the time after running the following code to get the sheet names out of an excel file, I will receive a windows error saying th

Re: [python-win32] 'exit is not defined'

2011-06-06 Thread Mark Hammond
On 3/06/2011 4:30 PM, Jacob Kruger wrote: What I'm doing is trying to open a text file, but if it's not there, then I tell the code to exit(), and while it works when running the source code using the python executable, after I have run the code through py2exe, and then try testing it, I get t

Re: [python-win32] pywin32 py2exe

2011-06-06 Thread Mark Hammond
On 3/06/2011 8:55 PM, Umesh Sharma wrote: hi, i am working on outlook automation , in my code i am using dispatchwithevents method for capturing events of outlook as newmail ,itemsend .The code works fine in command line but after converting it into exe file using py2exe ,the generated exe file c

Re: [python-win32] can't import dde module after importing win32ui

2011-06-10 Thread Mark Hammond
On 7/06/2011 9:11 PM, nekolyanich wrote: Michel Claveau mclaveau.com> writes: Hi! I have also/another problem with win32ui in 216 version: on several COM's servers, if the line import win32ui is present, servers can not be contacted. If I comment the line, no more problem. Uncomment,

Re: [python-win32] py2.7 and multiple DDE servers on Win32, possible?

2011-06-15 Thread Mark Hammond
On 11/06/2011 3:19 AM, RayS wrote: Hello I know that the default behavior since 2.? has been only one DDE server allowed. Is it possible to back-hack this restriction? It is possible, yeah - it's just a matter of someone doing it :) Cheers, Mark __

Re: [python-win32] py2.7 and multiple DDE servers on Win32, possible?

2011-06-15 Thread Mark Hammond
On 15/06/2011 8:15 PM, Mark Hammond wrote: On 11/06/2011 3:19 AM, RayS wrote: Hello I know that the default behavior since 2.? has been only one DDE server allowed. Is it possible to back-hack this restriction? It is possible, yeah - it's just a matter of someone doing it :) Oops -

Re: [python-win32] Creating PyCComboBox?

2011-06-15 Thread Mark Hammond
On 11/06/2011 4:55 PM, Greg Ewing wrote: How are you supposed to create a PyCComboBox? There doesn't seem to be a CreateComboBox function anywhere. I tried using CreateControl("COMBOBOX", ...) but it says that the CLSID is invalid. I think you just want a CreateWindow(Ex) with "Combobox" as th

Re: [python-win32] Telit PhytonWin

2011-06-15 Thread Mark Hammond
On 13/06/2011 10:00 PM, Famacoin wrote: Hi We have a problem loading script for the GM862-GPS module over 7k when we try to load gives ERROR IN THE DOWNLOAD, and sometimes says OK but does not load the entire file, we have checked the serial port but do not get the fault?. I'm afraid I have no

Re: [python-win32] Converting HTML formatting to Microsoft Word

2011-06-15 Thread Mark Hammond
On 14/06/2011 6:51 PM, sharpblade wrote: I whipped up this function: http://pastebin.com/kaZz5dBd which should work, but line 22 and 23 doesn't work for some reason - all text after it is bold. The last thing you do in those lines is set the range to bold - presumably later you then insert mor

Re: [python-win32] windows 2008 services on reboot

2011-06-23 Thread Mark Hammond
On 21/06/2011 8:58 AM, Matt Jibson wrote: I'm using the win32 extensions to install and run a service that can take 10-15 seconds to gracefully shutdown. It successfully receives the shutdown signal, but Windows Server 2008 kills the process before it can shutdown normally. Works fine on Windows

Re: [python-win32] UnicodeEncodeError getting Query String Data from ActiveX Scripting engine in classic asp

2011-06-30 Thread Mark Hammond
On 1/07/2011 12:57 PM, Chris Lambacher wrote: ... Maybe there should be a __unicode__ method on the class? Maybe __str__ should set an explicit encoding? Something like: def __unicode__(self): try: return unicode(self.__call__())

Re: [python-win32] Multiple versions of Python on same machine with regsvr32.exe PYDs

2011-07-14 Thread Mark Hammond
On 14/07/2011 4:39 AM, reckoner wrote: Hi, I have been researching this for a couple of days now, and although virtualenv seems like the answer, I have been reading about problems with applications that require specific versions of Python in the registry so it can find corresponding PYD and DLL

Re: [python-win32] Multiple versions of Python on same machine with regsvr32.exe PYDs

2011-07-18 Thread Mark Hammond
On 19/07/2011 12:21 AM, reckoner wrote: Mark: Thanks for your reply. I'm using the Python extension described here: http://www.synapseadaptive.com/joel/index_old.html Basically, the natlink.pyd file is called ( after being registered with regsvr32 ) indirectly by the speech recognition engine.

Re: [python-win32] How do I build manifest-less extension modules?

2011-08-04 Thread Mark Hammond
On 4/08/2011 7:24 AM, Will Sadkin wrote: So... Can someone tell me how to build our .pyd in VS2010 such that it doesn't have a manifest, and thus can be loaded by the Python2.7 interpreter? You should be able to use the cmdline option MANIFEST:NO to the linker - that is what pywin32 does. P

Re: [python-win32] manipulating service action restart behavior?

2011-08-12 Thread Mark Hammond
On 11/08/2011 7:31 AM, Andrew Hammond wrote: ... I suggest the attached patch to correct the error message. Excellent, thanks! I checked it in. Cheers, Mark ___ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listin

Re: [python-win32] Questions about deploying COM server via py2exe

2011-08-21 Thread Mark Hammond
On 21/08/2011 4:30 AM, Kevin Walzer wrote: Hi Matteo, Thanks for the suggestions. I have integrated the win32trace module into my frozen app. Here is my final code: ... This appears to be related to the bug logged at http://bugs.python.org/issue3905. My app makes use of subprocess to obtain va

Re: [python-win32] CF_ENHMETAFILE SetClipboardData 'The handle is invalid'

2011-08-21 Thread Mark Hammond
On 18/08/2011 1:02 AM, RuiDC wrote: import win32clipboard filename = r"C:\tmp\test.emf" with open(filename, "rb") as f: data = f.read() win32clipboard.OpenClipboard() win32clipboard.EmptyClipboard() win32clipboard.SetClipboardData(win32clipboard.CF_ENHMETAFILE, data) win32clipboard.CloseCl

Re: [python-win32] SHOpenFolderAndSelectItems

2011-08-21 Thread Mark Hammond
On 20/08/2011 5:40 AM, Scott Nelson wrote: ... Does pywin have support for SHOpenFolderAndSelectItems()? Unfortunately not - you can open a feature request at sourceforge and I'll add it for the next release. Cheers, Mark ___ python-win32 mailing

[python-win32] Fwd: Re: win32com + Excel + Django + Apache = problem

2011-09-04 Thread Mark Hammond
Just incase this helps anyone... Mark --- Begin Message --- Don't know if anyone cares about this issue: http://www.mail-archive.com/python-win32@python.org/msg08306.html and I'm not a member of the pythong-win32 mailing list, but here's the solution: It has nothing to do with pythoncom / win32c

Re: [python-win32] How to call Python methods and properties from VBS?

2011-09-05 Thread Mark Hammond
On 4/09/2011 11:35 PM, FT wrote: Hi Again, To be more specific I have compiled the Python inside a distributed package and need to know how to call from within that compiled package any method. In other words do I have to register the Python inside my .vbs script before calling any methods? I am

Re: [python-win32] How to call Python methods and properties from VBS?

2011-09-05 Thread Mark Hammond
Please keep replies on the python-win32 list - others may also be able to help you too. You might like to check out the sample in samples\pywin32\com_server in the py2exe distribution - that demonstrates a simple COM object and has a VBScript sample which calls it. Hope this helps, Mark On

Re: [python-win32] Loading C extensions in Python 2.6/2.7 from classic ASP

2011-09-06 Thread Mark Hammond
On 7/09/2011 5:17 AM, Chris Lambacher wrote: Hi, Whenever I load an extension using the ActiveX Script for Python in a Classic ASP page, I get an error saying the DLL can't be loaded. I have solved this problem thus far by patching the distutils source for my local Python instance and rebuilding

Re: [python-win32] Loading C extensions in Python 2.6/2.7 from classic ASP

2011-09-06 Thread Mark Hammond
00}\ProgID] @="Python.AXScript.2" [HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{DF630910-1C1D-11d0-AE36-8C0F5E00}\PythonCOM] @="win32com.axscript.client.pyscript.PyScript" [HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{DF630910-1C1D-11d0-AE36-8C0F5E00}\VersionIndependentProgID] @

Re: [python-win32] How to call Python methods and properties from VBS?

2011-09-08 Thread Mark Hammond
On 8/09/2011 11:20 PM, FT wrote: Mark, This script: set interp = CreateObject("Python.Interpreter") interp.Exec "import sys" Is this not calling a local computers installation of Python? If you built a DLL via py2exe and registered that, then it will not be using the local installation

Re: [python-win32] Loading C extensions in Python 2.6/2.7 from classic ASP

2011-09-08 Thread Mark Hammond
On 9/09/2011 12:58 PM, Chris Lambacher wrote: Hi Mark, It is not Wow64. I did a very basic test to see what I get. I installed 2.7.2 x64 and appropriate pywin32 216, and lxml 2.3, throw: import sys Response.Write(sys.version) import lxml.etree Response.Write("
Worked") into an ASP file and

Re: [python-win32] Loading C extensions in Python 2.6/2.7 from classic ASP

2011-09-11 Thread Mark Hammond
On 11/09/2011 9:20 AM, Chris Lambacher wrote: On Sun, Sep 11, 2011 at 11:57 AM, Chris Lambacher wrote: If so, that surprises me. To get as far as you did, much of the pywin32 framework was imported, so all those modules must have imported OK. I don't know why the imported pyd files are not

[python-win32] New win32com.client.VARIANT object

2011-10-11 Thread Mark Hammond
I just pushed a change which introduces a new win32com.client.VARIANT object. This object can be used in some situations to control the specific types passed as parameters to COM objects and should address a relatively common problem people hit when COM objects are very picky about the types t

Re: [python-win32] New win32com.client.VARIANT object

2011-10-12 Thread Mark Hammond
On 13/10/2011 12:16 AM, Michael Illgner wrote: 2011/10/12 Graham Bloice: Thanks Graham - I fixed the typo. I think this feature is great, the use case I run across most often is the last one mentioned, where the IDL specifies a VARIANT parameter but the COM object is actually much more pick

Re: [python-win32] windows service problem and twisted

2011-10-14 Thread Mark Hammond
On 14/10/2011 7:47 PM, John Aherne wrote: ... What I am trying to work out is should I import twisted.reactor etc inside the thread start in SvcDoRUn or import it globally as one of the examples does. Dunno - does the example work? If it does, then "yes" but if it doesn't, then "maybe not" :)

Re: [python-win32] win32gui.GetCursorInfo: TypeError: function takes no arguments

2011-10-28 Thread Mark Hammond
On 27/10/2011 5:52 PM, Anton Kurbatov wrote: May you help me, pls... I am using win7 ultimate. Installed version of python 2.5.1.1. (ActivePython with pywin32) I get the following msg: import win32gui print win32gui.GetCursorInfo() Traceback (most recent call last): File "", line 1, in Ty

Re: [python-win32] win32com in a 64bit laptop

2011-10-28 Thread Mark Hammond
If your version of Word is 32bit (which it probably is), you should just stick with the 32bit version of Python - it works fine on a 64bit machine. HTH, Mark On 29/10/2011 12:25 PM, love python wrote: I just got a 64bit laptop and install python 2.7.2 (Windows AMD64 / Intel 64 / X86-64 binar

Re: [python-win32] Full LOGFONT implementation

2011-11-04 Thread Mark Hammond
On 5/11/2011 2:57 PM, Kris Hardy wrote: All, I ran into an issue with the LOGFONT struct implementation which was not allowing me to set a few font options that I needed for an app I wrote. The problem was that the full LOGFONT struct had not been implemented. I have what seems to be a working p

Re: [python-win32] (no subject)

2011-11-06 Thread Mark Hammond
On 6/11/2011 11:33 PM, Michel Claveau wrote: Hi! In win32con, I do not found this constant: FILE_ATTRIBUTE_REPARSE_POINT = 1024 # 0x400 Exemple of use: import ctypes rep=u"C:\\web\\fichiers" FILE_ATTRIBUTE_REPARSE_POINT = 1024 # 0x400 vret = ctypes.windll.kernel32.GetFileAttributesW(rep) if vret

Re: [python-win32] WinSxS, manifests and binary distribution ?

2011-11-07 Thread Mark Hammond
I'm afraid some of the assembly stuff is truly black-magic to me, but I'll answer what I can. On 8/11/2011 1:28 AM, Robert wrote: ... Now when I move away the 5 MFC files (4 dlls + manifest) to _mv, then Pythonwin.exe still runs properly! And it does so until I move the folder C:\WINDOWS\WinS

Re: [python-win32] win32com and the GIL

2011-12-15 Thread Mark Hammond
On 13/12/2011 1:22 PM, Peter Fraser wrote: Hello Can win32com be made to release the GIL when it calls into COM components? Presumably it doesn't do this by default . It does do it by default and there is no way to have it *not* do it. I'm calling an apartment threaded COM component (VB6) an

Re: [python-win32] manifest "Microsoft.Windows.Common-Controls" version="6.0.0.0" => strange problem with pywin32 build 216 ?

2011-12-15 Thread Mark Hammond
On 19/11/2011 3:23 AM, Robert wrote: In C:\Python23 and C:\Python26 installations there are python(s).exe.manifest files which contain '"Microsoft.Windows.Common-Controls" version="6.0.0.0"' (see attached/below) With pywin32 build 216 (was not in 212; and 214 I guess) win32ui apps, which are sta

Re: [python-win32] python-win32 Digest, Vol 104, Issue 14

2011-12-15 Thread Mark Hammond
On 22/11/2011 2:10 PM, 陈智宏 wrote: http://sourceforge.net/tracker/?func=detail&aid=2831327&group_id=78018&atid=551954 UTC / Local time break pythonwin for Python32. A lot of function does not work. Simple throws

Re: [python-win32] addin fails to load the first time after login

2011-12-15 Thread Mark Hammond
I'm afraid I can't guess without a traceback. Try registering your addin with --debug and then run "python -m win32traceutil" - if you are luck you will also see the traceback there. Mark On 24/11/2011 8:09 AM, Christian K. wrote: Hi, I am observing a strange behaviour of two python com-ser

Re: [python-win32] Setting a 64bit FILETIME PT_SYSTIME property using pywin32's SetProps()

2011-12-15 Thread Mark Hammond
Attempting to pass an integer will assume the int is a regular "unix timestamp" and pywin32 will do the conversions as necessary. So there should be no need to convert it to a 64bit FILETIME integer. You should also find that passing a datetime object directly works, even in py2k builds - pyw

Re: [python-win32] Problem with Dispatch in normal Python shell

2011-12-19 Thread Mark Hammond
ot;, line 85, in _ GetGoodDispatch IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.II D_IDispatch) pywintypes.com_error: (-2147023898, 'Invalid access to memory location.', None, None) PythonWin 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32

Re: [python-win32] file descriptor issues using msvcrt.open_osfhandle()+os.fdopen()

2011-12-19 Thread Mark Hammond
On 18/12/2011 4:34 AM, Scott Leerssen wrote: On Dec 17, 2011, at 12:25 PM, Amaury Forgeot d'Arc wrote: 2011/12/17 Scott Leerssen mailto:sleers...@gmail.com>> I did see that, but I interpreted that to mean that the PyHANDLE would be dereferenced from the underlying Windows file handle,

Re: [python-win32] Problem : COM with Array Argument

2012-01-01 Thread Mark Hammond
On 22/12/2011 1:18 AM, randfb wrote: There's not an awful lot we can do here. Type code 24581 is a COM safe array of doubles, passed by reference. That seems to be what the documentation shows. You'd sure your values were all floats? I tried Ent.GetPoints(1,1, d) where d is a list of 3 floa

Re: [python-win32] problem AddLine AutoCAD win32com.client

2012-01-31 Thread Mark Hammond
Sadly not many people have access to autocad so it is hard to test. What errors do you get using win32com? Mark On 1/02/2012 5:11 AM, DANIEL POSE wrote: Hello, Recently I try to write some code to automate AutoCAD from Python. I have to draw lines from Python using win32com.client module, but

Re: [python-win32] problem AddLine AutoCAD win32com.client

2012-02-01 Thread Mark Hammond
(filename, glbs) File "C:\Documents and Settings\Usuario\Escritorio\borrar.py", line 15, in line = ms.AddLine(pt1, pt2) #This draw a line in AutoCAD File ">", line 3, in AddLine com_error: (-2147352567, 'Ocurri\xf3 una excepci\xf3n.', (0, None, None, Non

Re: [python-win32] python 3 support

2012-02-01 Thread Mark Hammond
On 2/02/2012 8:43 AM, Roman Morawek wrote: On 01.02.2012 21:51, Brian Curtin wrote: It has supported Python 3 since at least 2009. Interesting. It seems I just got confused by the list of the 25 most often nominated packages where users desire Python 3 support: http://python.org/3kpoll There

Re: [python-win32] Running Python + pywin32 portably

2012-02-03 Thread Mark Hammond
ts in Python instead of C++. Thanks, Bill On Fri, Jul 4, 2008 at 8:00 PM, Mark Hammond mailto:mhamm...@skippinet.com.au>> wrote: > I know it's possible with Python - but does pywin32 "work" if the > postinstall hasn't been run? Specifically, I don't

Re: [python-win32] win32file.CreateFile versus win32file.CreateFileW

2012-02-06 Thread Mark Hammond
On 7/02/2012 2:45 AM, Scott Leerssen wrote: I'm trying to open files with names that contain Japanese characters, and found that win32file.CreateFile would raise an exception indicating that 'The filename, directory name, or volume label syntax is incorrect'. I found win32file.CreateFileW (docum

Re: [python-win32] Python Windows Service and registering for preshutdown?

2012-02-06 Thread Mark Hammond
On 7/02/2012 5:18 PM, Lincoln Yeoh wrote: Hi, Is it easy to create a python windows service that registers for the preshutdown event[1]? It sounds like it should be easy, although you will need to define your own new constants which have been introduced. It would be great if you do get it w

Re: [python-win32] win32file.CreateFile versus win32file.CreateFileW

2012-02-07 Thread Mark Hammond
On Feb 6, 2012, at 5:40 PM, Mark Hammond wrote: On 7/02/2012 2:45 AM, Scott Leerssen wrote: I'm trying to open files with names that contain Japanese characters, and found that win32file.CreateFile would raise an exception indicating that 'The filename, directory name, or volume label

Re: [python-win32] lingering open filehandle?

2012-02-08 Thread Mark Hammond
On 9/02/2012 12:17 PM, Andrew Hammond wrote: We're using pycurl to download a file. The file is written to disk in the context of a with statement. Once the file is written, we exit the context and then do an os.rename() to move the downloaded file to it's final destination. Immediately before do

[python-win32] [ANN] pywin32 build 217 released.

2012-02-12 Thread Mark Hammond
Hi all, I'm happy to announce the release of pywin32 build 217. This release has addressed a number of issues with previous builds, has improved support for Python 3.x and 64bit builds and a number of new features - I've appended the change log at the end of this mail. For initial support

Re: [python-win32] Fwd: Cannot resize interactive window

2012-02-12 Thread Mark Hammond
It sounds like the interactive Window has been made a "docking" window but is undocked. Try View->Options->General Options and make sure the "dockable window" option is unchecked. Or if you just want to re-dock it, drag the caption to one of the edges of the main Pythonwin window. Hope I've

Re: [python-win32] Problem when I install PIL on WinXP as non-admin

2012-02-13 Thread Mark Hammond
On 11/02/2012 10:46 PM, yaoyansi wrote: Hi all, I installed python-2.6.5.msi on my WinXP long time ago, Today I installed PIL-1.1.7.win32-py2.6.exe as non-admin. Then I make a simple test: python import Image Traceback (most recent call last): File "", line 1, in ImportError: No module na

Re: [python-win32] How do I detect a 64 bit version of Windows?

2012-02-18 Thread Mark Hammond
You can check for "64 bit" in sys.version (or use the platform module as suggested by Brian) - if it is there it *must* be a 64bit Windows. If it is not there (ie, it is a 32bit Python), then call win32process.IsWow64Process() - if it returns True it is a 64bit windows, otherwise 32bits. Thi

Re: [python-win32] How do I detect a 64 bit version of Windows?

2012-02-19 Thread Mark Hammond
On 19/02/2012 6:20 PM, Brian Curtin wrote: On Sat, Feb 18, 2012 at 21:11, Gelonida N wrote: On 02/18/2012 09:07 PM, Brian Curtin wrote: On Sat, Feb 18, 2012 at 13:22, Gremlin wrote: import platform platform.machine() That will return "AMD64" on 64 bit. I don't have a 32-bit machine availabl

Re: [python-win32] [ANN] pywin32 build 217 released.

2012-02-19 Thread Mark Hammond
On 20/02/2012 5:10 AM, luc.k wrote: Hi Marc, I recently encounterd some problems with pyTables en Pandas. (certain pyd files generated an "Import DLL"problem) After some research i came accross the folowing issues - http://bugs.python.org/issue4120 - http://bugs.python.org/issue7833 and It's

Re: [python-win32] [ANN] pywin32 build 217 released.

2012-02-20 Thread Mark Hammond
On 21/02/2012 9:05 AM, Luc Kesters wrote: Hello Mark, I installed the new pywin32. I don't have a problem with pywin32 itself. But when importing other packages (the ones I mentioned) I still have the problem (see below) When I read the issues (see first message) it seemed to me a python problem

Re: [python-win32] [ANN] pywin32 build 217 released.

2012-02-20 Thread Mark Hammond
On 21/02/2012 2:02 AM, etienne.laba...@free.fr wrote: For initial support (eg, to ask questions about the release etc), please contact this mailing-list (python-win32@python.org). If you want to report a bug, please do so at https://sf.net/projects/pywin32. Hello Mark, I don't know if this is

Re: [python-win32] COM-interfaces in python

2012-02-20 Thread Mark Hammond
On 21/02/2012 12:18 AM, Rafael Yengibaryan wrote: Hi all. I need some COM-interfaces for virtual disk service(VDS) that are not supported by standard win32com package. Which are the ways to be able to use these interfaces in python code? If they are interfaces not supported via IDispatch, then

Re: [python-win32] Python-based Windows service: Subcommand works with "debug", but hangs under "start"

2012-02-20 Thread Mark Hammond
I guess it depends on what that child process does. Services run on a different desktop, so any UI (eg, message box or similar) or attempts to read from stdin etc will make it appear to have hung. Using a windows debugger (or even "process explorer" from the MS SysInternals team) might give y

Re: [python-win32] COM-interfaces in python

2012-02-21 Thread Mark Hammond
k Bill Sent from my Verizon Wireless BlackBerry -Original Message----- From: Mark Hammond Sender: python-win32-bounces+bill=tutts@python.org Date: Tue, 21 Feb 2012 10:53:22 To: Rafael Yengibaryan Reply-To: mhamm...@skippinet.com.au Cc: Subject: Re: [python-win32] COM-interfaces in python O

Re: [python-win32] Standalone pywin32

2012-02-26 Thread Mark Hammond
On 24/02/2012 1:51 PM, JohnM wrote: We have a project where we are running a local (read not installed) copy of Python, and we need to run our code as a service. We love pywin32, its perfect. We can't figure out how what pieces need to be where to run as a service. For example, your post instal

Re: [python-win32] Running a Windows Python service without pythonservice.exe?

2012-02-26 Thread Mark Hammond
On 23/02/2012 4:36 PM, Kyle wrote: Bill, did you ever find a resolution to your pythonservice.exe issue? I've got the PyWin32 extensions installed in a private site-packages directory under my stuff, which isn't the same as the Python site-packages site. I need a way to set PYTHONPATH, or in s

Re: [python-win32] Help Needed on Handling Events from a Proprietary COM Object

2012-02-28 Thread Mark Hammond
On 29/02/2012 8:26 AM, Darren McElfresh wrote: I’ve read through numerous posts on how to get this to work, but I’ve realized it is time to ask for help. In general I have a COM object that returns an event handler: /event_source = com_object.newEventSource( arg_data )/ I’ve tried establishing th

Re: [python-win32] Help Needed on Handling Events from a Proprietary COM Object

2012-03-04 Thread Mark Hammond
p;m_cookie); if (!VerifyHR(hr, IID_IConnectionPoint, m_cp)) { return(false); Any ideas on what I'm missing? Is it that the object is an Dispatch Interface, and so I'm not handling that correctly? Thanks, Darren *From:

Re: [python-win32] Context menu troubles

2012-03-04 Thread Mark Hammond
On 3/03/2012 6:09 AM, Chris Ness wrote: Also, the first article mentions OleInitialise(), which I tried but pythoncom.OleInitialise() does not exist in the module (AttributeError), despite what the docs say? The function is spelt with a "z" rather than the "s": >>> import pythoncom >>> pythonc

Re: [python-win32] windows firewall woes?

2012-03-08 Thread Mark Hammond
As a couple of guesses, I'd ensure you do this from an elevated process (ie, "run as administrator") and also be sure to use fully-qualified paths. (The error code shown appears to be ERROR_INVALID_POINTER, but that might be a red herring) Mark On 9/03/2012 11:16 AM, Andrew Hammond wrote: W

Re: [python-win32] How to write a COM Server implementing interfaces from type lib?

2012-03-22 Thread Mark Hammond
On 22/03/2012 2:53 AM, Jan Wedel wrote: Hi, I'm currently having trouble to write a COM-Server that has some special requirements: - It needs to derive from IUnknown - It needs to implement multiple interface from two different proprietary typelibs (dlls) - It needs to implement a custom categor

Re: [python-win32] How to write a COM Server implementing interfaces from type lib?

2012-03-22 Thread Mark Hammond
mmon.IOPCCommon, OpcCommon.IConnectionPointContainer, OpcDa.IOPCServer, OpcDa.IOPCItemProperties] I don't know what to do. Is there anything more I can do to debug to find out WHAT exactly causes the error? Because as you can see, the pythoncom debug output doesn't show this error that i

Re: [python-win32] How to write a COM Server implementing interfaces from type lib?

2012-03-22 Thread Mark Hammond
on class EttexOPCServer2(OpcCommon.IOPCCommon, OpcCommon.IConnectionPointContainer, OpcDa.IOPCServer, OpcDa.IOPCItemProperties): _reg_progid_ = "Ettex.OPC.Automation2" _reg_desc_ = "ettex OPC DA Server 2" _reg_novers_progid_ = _reg_progid_ _reg_clsid_ = "{80A2B8F7-792E-43

Re: [python-win32] a question about word addin , IRibbonExtensibility, GetCustomUI, getImage, IPicture

2012-03-24 Thread Mark Hammond
On 24/03/2012 6:24 PM, shuwj wrote: hi, I'm writing an addin for ms word 2010. It will show a tab named JJ in which there are two buttons. one labels doo, the other labels doo2. doo2 should be displayed with customization image(edit.png) but don't show as expected. debugging with pythonwin t

Re: [python-win32] a question about word addin , IRibbonExtensibility, GetCustomUI, getImage, IPicture

2012-03-25 Thread Mark Hammond
I'm not familiar enough with ctypes to know if that makes sense, but I doubt it - nothing would seem to know the size of the buffer pointed at by 'x'. You probably need to stick with using a python string object - ensure the string contains exactly the bytes of the metafile. Mark On 25/03/20

Re: [python-win32] How to write a COM Server implementing interfaces from type lib?

2012-03-29 Thread Mark Hammond
back (most recent call last): File "", line 1, in pywintypes.com_error: (-2147024809, 'Falscher Parameter.', None, None) Unfortunately, as you can see, it doesn't work. Do you know if there is a way to get a more verbose error message or some COM debugging console to know w

Re: [python-win32] wait for new clipboard data?

2012-03-31 Thread Mark Hammond
I think there is a clipboard watcher concept, but pywin32 doesn't expose it. One option might be to simply poll win32clipboard.GetClipboardSequenceNumber() - but the docs list some caveats which might mean it doesn't work in all cases (specifically in delayed rendering) Cheers, Mark On 1/

Re: [python-win32] [pywin32 extensions] Traceback error on running startup script

2012-04-01 Thread Mark Hammond
Are you building your code as a unicode application? In Python 3.3, the "TCHAR" will actually be unicode. If you do roll back to python 2.x, it will be a regular "char *". Mark On 2/04/2012 2:04 AM, Maggard, Eric wrote: Hi, I am working on a Win7 machine (64-bit), but would like to embed p

Re: [python-win32] IActiveScript::AddNamedItem fails with exception

2012-04-02 Thread Mark Hammond
On 3/04/2012 2:51 AM, Tim Roberts wrote: David Manns wrote: We have a scripting engine interface in our application. This works fine for loading/calling VBscript and Javascript scripting engines, but PythonScript fails. Specifically, it fails at : m_pAxsScript->AddNamedItem("application",

Re: [python-win32] IActiveScript::AddNamedItem fails with exception

2012-04-02 Thread Mark Hammond
On 3/04/2012 1:09 AM, David Manns wrote: We have a scripting engine interface in our application. This works fine for loading/calling VBscript and Javascript scripting engines, but PythonScript fails. Specifically, it fails at : m_pAxsScript->AddNamedItem("application", SCRIPTITEM_NAMEDITEM

Re: [python-win32] IActiveScript::AddNamedItem fails with exception

2012-04-04 Thread Mark Hammond
On 4/04/2012 6:02 PM, David Manns wrote: Mark, Tried doing that, but nothing comes out on the debug trace at all. Do I have to uncomment or add any trace commands in any of the .py files, or should I expect to see things appear on the console already? Ack - sorry about that: * Execute "pytho

Re: [python-win32] IActiveScript::AddNamedItem fails with exception

2012-04-04 Thread Mark Hammond
On 4/04/2012 8:20 PM, David Manns wrote: Mark, Thanks, that's better! Now I get this trace output: Collecting Python Trace Output... Object with win32trace dispatcher created (object=None) in ._InvokeEx_-SetScriptSite(,) [1,0,None] Debugging interfaces not available - debugging is disabled..

Re: [python-win32] Why does a python COM server return different data to VBA and Python clients?

2012-04-12 Thread Mark Hammond
On 10/04/2012 3:40 AM, jeffwe...@earthlink.net wrote: My apologies to the list about my earlier question that was in html. My webmail is supposed to default to plain text but clearly did not. I am trying to write a Python server that will be used by a C++ client. It has taken me quite a while

Re: [python-win32] Need advice on iterator implementation in scripting host

2012-04-16 Thread Mark Hammond
On 13/04/2012 9:14 PM, Pulsonix Tech Support wrote: We have an ActiveX scripting host implementation in our application (written in C++), so that users can run scripts to access our data from inside the application. Current problem is that iterating from Python script doesn’t work right. You can

Re: [python-win32] PyIMAPIFolder.DeleteFolder ??

2012-04-16 Thread Mark Hammond
On 14/04/2012 1:39 AM, Sriram ET. wrote: I am trying to programatically delete a Contacts folder (that I programatically created using PyIMAPI.CreateFolder), when I get the following exception: AttributeError: 'PyIMAPIFolder' object has no attribute 'DeleteFolder' I can see there is an EmptyFo

Re: [python-win32] Error trying to do a EmptyFolder() (MAPI)

2012-04-16 Thread Mark Hammond
On 14/04/2012 3:19 PM, Sriram ET. wrote: I have a folder in the Root Folder of a message store that I am trying to clear using EmptyFolder(). The code is as follows: folder = store.OpenEntry(eid, None, MOD_FLAG) hr = folder.EmptyFolder(0, None, 0) I get the err

Re: [python-win32] PyIMAPIFolder.DeleteFolder ??

2012-04-16 Thread Mark Hammond
On 17/04/2012 3:37 PM, Sriram ET. wrote: On Tue, Apr 17, 2012 at 6:49 AM, Mark Hammond mailto:skippy.hamm...@gmail.com>> wrote: On 14/04/2012 1:39 AM, Sriram ET. wrote: I am trying to programatically delete a Contacts folder (that I programatically created

Re: [python-win32] vb errors from Python COM object now include the traceback lines

2012-04-19 Thread Mark Hammond
On 20/04/2012 8:30 AM, Lloyd Kvam wrote: On Thu, 2012-04-19 at 16:32 -0400, Lloyd Kvam wrote: I am hoping one of you can point me in the right direction. My alternative appears to be (painfully) writing some VB code to discard the traceback lines from Err.Description. Hrm - I thought it had

<    1   2   3   4   5   6   7   8   9   10   >