Re: [python-win32] speed up win32com.client

2012-05-12 Thread Mark Hammond
On 13/05/2012 5:00 AM, DANIEL POSE wrote: I had tried to change attribute name in several ways (InsertionPoint, insertionPoint, insertionpoint,...) but I obtained the same error: Traceback (most recent call last): File ipython console, line 1, in module File

Re: [python-win32] speed up win32com.client

2012-05-11 Thread Mark Hammond
On 10/05/2012 12:33 AM, Tom wrote: Sorry to interject here but I have a question along the same vein: If I have a script (in this case that interacts with Word through win32com.client) with statements like this: doc.ActiveWindow.Selection.BoldRun() doc.ActiveWindow.Selection.TypeText(_type)

Re: [python-win32] speed up win32com.client

2012-05-11 Thread Mark Hammond
On 10/05/2012 6:38 AM, DANIEL POSE wrote: I have read about Early Binding but I hadn't tested the line that you reference: acad= win32com.client.gencache.EnsureDispatch(AutoCAD.Application) For my surprise, if I replace line: acad= win32com.client.Dispatch(AutoCAD.Application) for the line:

Re: [python-win32] win32evtlog - Event Log parsing issue

2012-05-03 Thread Mark Hammond
I'm afraid I'm not familiar with that API, but the crash is because EvtOpenLog is returning a handle with a value of 1 and ReadEventLog is crashing with that handle. A quick google doesn't find anyone trying to use ReadEventLog with a handle returned by EvtOpenLog but instead uses

Re: [python-win32] Win32api install problem

2012-04-30 Thread Mark Hammond
On 30/04/2012 5:56 PM, Tim Golden wrote: On 30/04/2012 08:50, Mark Hammond wrote: On 30/04/2012 5:42 PM, Tim Golden wrote: (I was just about to get in touch with Mark H and offer a patch but I won't have time to do the mechanics until this afternoon at the earliest...) Thanks for the clue

Re: [python-win32] PumpMessages in main thread called by embedded Python causes crash

2012-04-29 Thread Mark Hammond
messages (pythonwin has some support for that, and another package called PyHook might also help). Mark Thanks! On Saturday, April 28, 2012 10:15:50 PM, Mark Hammond wrote: I don't know why it crashes exactly, but if the other app has its own event loop then things are going to get screwey

Re: [python-win32] PumpMessages in main thread called by embedded Python causes crash

2012-04-29 Thread Mark Hammond
I'm afraid my only other idea is to contact the vendor of the other app and see if they can shed any light on the problem... Cheers, Mark On 30/04/2012 10:49 AM, reckoner wrote: On 4/29/2012 3:48 PM, Mark Hammond wrote: On 30/04/2012 1:07 AM, reckoner wrote: Thanks for your reply. Yes

Re: [python-win32] PumpMessages in main thread called by embedded Python causes crash

2012-04-28 Thread Mark Hammond
I don't know why it crashes exactly, but if the other app has its own event loop then things are going to get screwey - PumpMessages never returns (well, not until a WM_QUIT message is received), so their event loop will never run. I'd guess that their event loop and event handlers have some

Re: [python-win32] Silent crashes in calls to a COM object in Python

2012-04-24 Thread Mark Hammond
On 25/04/2012 7:14 AM, Deniz Pelvan wrote: Hello again Mark,I am not sure what you mean by direct call? The COM object is loaded inproc (i.e. the COM object is not in a service proc and I don't see any temp processes created by python or pywin32) but I thought you were using the IDispatch

Re: [python-win32] pywin32 and Windows Filtering Platform?

2012-04-23 Thread Mark Hammond
The documentation is pretty sparse - you should look at the demo file win32comext\ifilter\filterDemo.py and look at the MS docs for the gory details... HTH, Mark On 21/04/2012 7:39 PM, Dan wrote: I have been developing in python for a few years now on unix. I'm dipping my feet into the

Re: [python-win32] Silent crashes in calls to a COM object in Python

2012-04-23 Thread Mark Hammond
Python and pywin32 don't impose any time limits for timeouts and I can't think of what could cause this other than (say) an exception handler in your script that ignores exceptions and terminates the process. Even if Python actually crashed I'd expect Windows to show the app crashed dialog.

Re: [python-win32] Silent crashes in calls to a COM object in Python

2012-04-23 Thread Mark Hammond
On 24/04/2012 2:55 PM, Deniz Pelvan wrote: Hello Mark, As I mentioned, I ran my COM interface with another Win32 test app under a MSVC debugger for hours without any problem. I attached a debugger to the Python process but with Python, the script goes all the way to that call, waits about a

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

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

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

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 skippy.hamm...@gmail.com 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

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] 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

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 win32com.axscript.client.pyscript.PyScript instance at

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] [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

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

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

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

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

2012-03-22 Thread Mark Hammond
On 22/03/2012 11:51 PM, Jan Wedel wrote: Hi Mark, thanks for your reply. That's E_FAIL which is pretty generic. Doesn't sound like a simple failure to QI for the correct interface. Yeah. The client says something like Unknown Error which makes it hard to tell what the problem actually is.

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

2012-03-22 Thread Mark Hammond
On 23/03/2012 3:54 AM, Jan Wedel wrote: I've actually managed to patch the policy.py to allow multiple typelibraries. Instead of having a definition for interfaces, type library id, version etc i've build this into one tuple. I've created a new attribute that can have multiple of these tuples.

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:

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

2012-03-04 Thread Mark Hammond
)) { 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:* Mark Hammond skippy.hamm...@gmail.com *To:* Darren McElfresh

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

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

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

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

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

2012-02-21 Thread Mark Hammond
On 22/02/2012 1:52 AM, bill.t...@gmail.com wrote: Ctypes doesn't add any breadth in this area? (I don't have a clue since ctype com stuff didn't exist when I last cared.) Yeah, ctypes (and/or comtypes) should almost certainly be the foundation for any work like this. Mark Bill Sent

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

2012-02-20 Thread Mark Hammond
=-1 Script_Error_LineNr=24 Script_Error_Text=import pandas Win32errorMessage=Exception occurred -- From: Mark Hammond skippy.hamm...@gmail.com Sent: Monday, February 20, 2012 12:36 AM To: luc.k luc.kest...@hotmail.com Cc: python-win32@python.org

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

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,

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

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 Ngelon...@gmail.com wrote: On 02/18/2012 09:07 PM, Brian Curtin wrote: On Sat, Feb 18, 2012 at 13:22, Gremlingrem...@armarize.com wrote: import platform platform.machine() That will return AMD64 on 64 bit. I

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 DLLproblem) 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] 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. This

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 stdin, line 1, inmodule ImportError: No

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] 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

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

2012-02-07 Thread Mark Hammond
: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 syntax is incorrect'. I found

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

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

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

2012-02-03 Thread Mark Hammond
of C++. Thanks, Bill On Fri, Jul 4, 2008 at 8:00 PM, Mark Hammond mhamm...@skippinet.com.au 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 care about embedding Python

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

2012-02-01 Thread Mark Hammond
Pose. 2012/2/1 Mark Hammond skippy.hamm...@gmail.com mailto:skippy.hamm...@gmail.com 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

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] 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,

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

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

2011-12-19 Thread Mark Hammond
, 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 bit (Intel)] on win32. Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for further copyright

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 sleers...@gmail.com mailto:sleers...@gmail.com I did see that, but I interpreted that to mean that the PyHANDLE would be dereferenced from the underlying

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

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=detailaid=2831327group_id=78018atid=551954 http://sourceforge.net/tracker/?func=detailaid=2831327group_id=78018atid=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

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 -

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

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=uC:\\web\\fichiers FILE_ATTRIBUTE_REPARSE_POINT = 1024 # 0x400 vret = ctypes.windll.kernel32.GetFileAttributesW(rep) if vret

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

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 stdin, line 1,

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

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] 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 Bloicegraham.blo...@trihedral.com: 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

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 ch...@kateandchris.net 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

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 of

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: script language=python runat=server import sys Response.Write(sys.version) import lxml.etree

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

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 12:56 PM, Chris Lambacher wrote: Hi Mark, It looks like it is trying to use pythoncomloader26.dll. Maybe it is to due with the Wow64 stuff? I've pasted the Registry values below in case you can get any insight into it. If you have any suggestions about how to go about debugging it.

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

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

2011-09-04 Thread Mark Hammond
Just incase this helps anyone... Mark ---BeginMessage--- 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 /

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

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 = rC:\tmp\test.emf with open(filename, rb) as f: data = f.read() win32clipboard.OpenClipboard() win32clipboard.EmptyClipboard() win32clipboard.SetClipboardData(win32clipboard.CF_ENHMETAFILE, data)

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

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

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.

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

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] 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] 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 - sorry

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 the

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

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 Claveaumcat 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.

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

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

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] 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

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] 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()

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 creating

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

Re: [python-win32] DispatchWithEvents

2011-05-04 Thread Mark Hammond
On 4/05/2011 12:39 AM, Michael Illgner wrote: 2011/5/3 Mark Hammondmhamm...@skippinet.com.au: 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

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 Hammondmhamm...@skippinet.com.au: 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

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

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

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

2011-04-21 Thread Mark Hammond
That is awesome - thanks very much. It works as advertised (although there was one trivial problem in the patch when generating COM objects that I fixed.) It works just fine with a py2k build, so all I need to do it integrate the changes Roger made for py3k into the mix and we are in a much

<    1   2   3   4   5   6   7   8   9   >