Re: [python-win32] Python Programming on Win32 Book

2006-04-29 Thread Mark Hammond
Mark, Is there going to be a 2nd Edition of your Python Programming on Win32 book? If so, when do you think it will be released? I hope to have this complete this year, so released some time next year. Of course, that means I need to *start* it this year. I've one or two people lined up to

Re: [python-win32] adding icon in an exe

2006-05-02 Thread Mark Hammond
Does anyone know of a way to add an icon to an existing .exe file on win32 platform using win32all package? With some pain :( You need to put together the .ico structure yourself and use the BeginUpdateResource() etc win32 functions. The only working code I know (off the top of my head) is in

Re: [python-win32] missing or broken dll

2006-05-04 Thread Mark Hammond
H J van Rooyen writes: It works fine under Linux (/dev/ttys0) but under windoze 95 I am having no joy. ... import win32file Traceback (most recent call last): File E:\Python24\Tools\Scripts\junk1.py, line 1, in ? import win32file ImportError: DLL load failed: A device attached to

Re: [python-win32] win32com. Python long to VARIANT conversion patch.

2006-05-06 Thread Mark Hammond
I'm new to this thread, so please excuse me if this already been discussed or have already been patched. While working with COM I've noticed that sometimes Python long values does not convert correctly to COM VARIANT (I assumed that VT_{I4,UI4,I8,UI8,BSTR} should be used). Can you give

Re: [python-win32] Why I get wrong filetime values with win32 api(FindFilesW) ?

2006-05-09 Thread Mark Hammond
I need to get filelists from many HDD-s with more props. of files. I used FindFilesW to get these informations. But I have a problems with it. When I used Find_Data tuple, and it's atime,ctime,mtime props, I get wrong result. I have hungarian Windows (XP), so little time diff. I have.

Re: [python-win32] Outlook Addin Help

2006-05-11 Thread Mark Hammond
Object with win32trace dispatcher created (object=None) Gateway Count: 2 Interface Count: 4 Is there something I should try to get the Interface Count down to zero? In Spambayes, I previously tried everything I could think of to locate them. I guess additional analysis is necessary to

Re: [python-win32] Outlook Addin Help

2006-05-16 Thread Mark Hammond
I think the problem is with the ActiveExplorer object(s). When I get them released or set to None, then Outlook is happy to shutdown immediately (even when *other* interfaces are still referenced). If the ActiveExplorer object(s) are still referenced, then Outlook stays in memory (apparently

Re: [python-win32] Try to got short path for files - but got error...

2006-05-24 Thread Mark Hammond
I'm afraid your message isn't very clear. You should try and copy the smallest possible code that demonstrates your problem, exactly as Bobby did in his reply. I got errors with unicode file names. See my unicode test file name: UFN=u'%s\\xA\xff'%os.getcwd() Is that what you mean? You

Re: [python-win32] Try to got short path for files - but goterror...

2006-05-24 Thread Mark Hammond
Mark, Do you know if it's possible to get all the usual right-click file properties using win32com or ctypes? I know Windows presents short names via properties, but wasn't sure that's exposed via either. I googled this but didn't see a clear direction after the first 50 hits. May be

Re: [python-win32] Try to got short path for files - but goterror...

2006-05-25 Thread Mark Hammond
On 25/05/2006 8:12 PM, Metz, Bobby W, WWCS wrote: Mark, Thanks for that. I didn't read an earlier entry from the submitter close enough. Someone else had told them that GetShortPathName wasn't supported but I didn't pay attention to the W at the end...could have saved myself a

Re: [python-win32] Adding AutoCAD Points.

2006-06-05 Thread Mark Hammond
Hi Dan, I was wondering what happened to that patch - I'm glad it still lives :) Mark and I had taken that discussion off the list way back in February, and I'll leave it to him if he wants it back on the list. I'm happy for all 'functionality' discussions to happen on list - but if it is

Re: [python-win32] slightly OT: missing windows.h/afxwin.h--how do Iget them?

2006-06-07 Thread Mark Hammond
I'm surprised windows.h doesn't come with Express Edition - but I'm fairly sure it comes with the platform sdk - which is necessary for many of the modules anyway. afxwin.h is an MFC header, and IIUC, that is not available without the full-blown MSVC. This will prevent you building

Re: [python-win32] Unicode build of win32gui outside of WinCE?

2006-06-18 Thread Mark Hammond
Are there any plans to support a Unicode build of win32gui in PyWin32 outside of Windows CE? Perhaps the winxpgui module could be built with UNICODE defined while the win32gui module is not. Alternatively, both could be built with UNICODE defined and use the Microsoft Layer for Unicode to

Re: [python-win32] Pure Python Pythonwin.exe

2006-06-21 Thread Mark Hammond
Pythonwin the IDE has many fans, and I would like to get it working with Movable Python [#]_. Great! Pythonwin is launched with 'pythonwin.exe'. Presumably (I speak from ignorance here) this uses the registry to determine the installed Python. Nope - it uses some old code that really

Re: [python-win32] SafeTerminateProcess and request forCreateRemoteThread()

2006-06-22 Thread Mark Hammond
- The first is the request to include CreateRemoteThread in win32api (which I will post on sourceforge) Done. - Does anyone know a similarly safe way for terminating a process so that a SIGINT/SIGTERM handler will still be called (without the need for a shared console or process group

Re: [python-win32] com servers and py2exe

2006-06-25 Thread Mark Hammond
Py2exe supports making com servers as dlls or as exes. After I create a com server with py2exe, how do I get it registered? If it is a .exe, you just run it. If it is a DLL, you use regsvr32.exe to register it - ie, you register them just like any other COM EXE or DLL files. If I need to

Re: [python-win32] Simple Com Event Handling for Multiple ComObjects

2006-06-26 Thread Mark Hammond
I'm afraid you probably need to pull win32com.client.WithEvents apart and manually setup your own event handler class. Different events do need different functions (although it should be possible to add the same event handler to 2 different event sources. Cheers, Mark -Original

Re: [python-win32] Python/ASP Request data with non ascii characters

2006-07-03 Thread Mark Hammond
Hi Mark, thanks for the reply. The attribute you where thinking off is `Item`. What I'll need to work out now is which code page has been used to encode that Unicode string. I'm not sure that is relevant. If I understand correctly, the code-page is only used when converting from a string of

Re: [python-win32] Non-ascii character in source code cause 'Exceptionoccurred'

2006-07-03 Thread Mark Hammond
Any presence of a non-ascii character, even if it is in the comment only, would cause this problem. I have tried various encoding, with or without BOM, and also adding the encoding specification at the top of the file. All these give the same result. On the other hand a similar Javascript

Re: [python-win32] Transparent Windows - API failure

2006-07-06 Thread Mark Hammond
Also, any workaround to using SetLayeredWindowAttributes on Win2000? I noticed in the docs it's not in win32gui to prevent issues with NT? Well - prevent issues actually translates to easier :) A better work-around would be to have the C++ code use LoadLibrary, and I'd be happy to accept such

Re: [python-win32] Calling Labview 8 via Python and COM

2006-07-06 Thread Mark Hammond
Is there a way to patch this new feature into the distribution I'm using, without changing the whole setup of the SW? This function should patch into that win32all version just fine. Locate the method definition in win32com\client\dynamic.py, and just paste it directly into the relevant

Re: [python-win32] Trouble Automating Alibre CAD package

2006-07-09 Thread Mark Hammond
When I try the same thing in a vbs script, and run with wscript: Dim AlibreHookAlibreHook = GetObject(, AlibreX.AutomationHook) Dim AlibreRootAlibreRoot = AlibreHook.Root WScript.Echo(Version AlibreRoot.version) I get the error: Line: 4 Char: 9

Re: [python-win32] Trouble Automating Alibre CAD package

2006-07-09 Thread Mark Hammond
I know this isn't the (strictly) correct group to ask this, but does anyone know if ctypes has any more capabilities with regard to this problem? I believe it does, yes, although I've never attempted to use it. Longer term, I can picture ctypes being used by pywin32 to also provide that

Re: [python-win32] Trouble Automating Alibre CAD package

2006-07-12 Thread Mark Hammond
Thomas wrote: I'm not sure pywin32 can handle such a buggy object, but you could probably try to run makepy on the typelib and then create the object. What might work here is to pass a secret second arg to QueryInterface. This second arg can be the IID of the object returned from the call.

Re: [python-win32] win32pdhutil.ShowAllProcesses() fails

2006-07-14 Thread Mark Hammond
I'm afraid I can't help much. It looks like the API function is failing with PDH_CSTATUS_NO_OBJECT. A quick google for this shows a win2k related knowledge-base article, but nothing specific to Windows XP - but hopefully knowing the exact error code being returned by PDH is useful. Cheers,

Re: [python-win32] RE : RE : win32pdhutil.S howAllProcesses() fails

2006-07-16 Thread Mark Hammond
Yes, it works! Thank you very much! (actually Process ID also had to changed) Maybe the function should be updated in next releases? Hi Charles, I've changed that module to localize the 'constant' names in that file. Thanks, Mark attachment:

Re: [python-win32] ConnectNamedPipe Defect???

2006-07-16 Thread Mark Hammond
I am checking the return type something like this CreateNamedPipe. While... hr = ConnectName if(hr !=0 and hr!=win32pipe.ERROR_PIPE_CONNECTED): raise MyOwnException DoSomeStuff Ideally it should return 535 for ERROR_PIPE_CONNECTED. But

[python-win32] pywin32 build 209

2006-07-16 Thread Mark Hammond
Hi all, I've just released pywin32 build 209. Due to my error while uploading the files, builds for Python 2.2 and 2.3 will be delayed for about 48 hours - but Python 2.4, 2.5 and source releases are available now. Particular thanks goes to Roger Upole who contributed the majority of the work

Re: [python-win32] pywin32 build 209

2006-07-18 Thread Mark Hammond
Mark Hammond wrote: Hi all, I've just released pywin32 build 209. Due to my error while uploading the files, builds for Python 2.2 and 2.3 will be delayed for about 48 hours - but Python 2.4, 2.5 and source releases are available now. Fantastic! BTW If you're waiting for the files

Re: [python-win32] IPC between Python and a win32 process

2006-07-24 Thread Mark Hammond
I have a win32 application written in C that does some background processing (process1). Users can have some limited interaction with the C application via a python Gui running in a separate process (process2). What is the easiest way for the C application and the python Gui to communicate?

Re: [python-win32] Dispatches With Events on COM Object

2006-08-03 Thread Mark Hammond
print dir(mod) ob = mod.Application Try adding parens after that line - currently 'ob' is the class, where you want an instance of the class. ob = mod.Application() That may get closer. Mark ___ Python-win32 mailing list Python-win32@python.org

Re: [python-win32] OLE Server Busy dialog box

2006-08-09 Thread Mark Hammond
I can throw you a new win32uiole module with the functions referenced in the knowledge base article, but apart from trying to fiddle with the main thread's thread-state (search for 'sys.coinit_flags'), I can't offer much more help... Mark Some more details about the server busy dialog box.

Re: [python-win32] Dispatches With Events on COM Object

2006-08-09 Thread Mark Hammond
* The call to Dispatch happens * The __wrapDispatch is called with an object for dispatch but the username is None * The getTypeInfo method throws an pywintypes.com_error which has the message of (-2147467263, 'Not implemented', None, None) It is that last step where

Re: [python-win32] Variant ByRef 2D array returned as 1D array

2006-08-16 Thread Mark Hammond
I'm working with a COM module that is returning a 2D array as a VARIANT BYREF. The 2D array is 30x8 (with each entry being 1 byte) When the data is returned I'm getting a buffer of length 30. This tells me that win32com only sees 1D of the array (documentation states that the buffer is

Re: [python-win32] Multithreaded Service

2006-08-16 Thread Mark Hammond
If your application works as expected before converting to a service, there should be no problem getting it working as a service. At the most basic level, your service's main thread can do nothing more than interact with the service control manager, and your application code should be able

Re: [python-win32] python and rtf

2006-08-18 Thread Mark Hammond
You may be better off trying the various wx mailing lists - not many wx people hang out here (I guess as most wx users are targetting more than Windows!) Regards, Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Christopher Frauenberger Sent:

Re: [python-win32] smart : __del__ replace atexit

2006-08-22 Thread Mark Hammond
A little stunt : in COM server (with pywin32), atexit is not interesting. Yeah, Python is never 'finalized' when it is loaded for use by a COM object. Then, look, in the class-serverCOM, the method __del__(self): When you close the COM-server, or when you exit the application who called

Re: [python-win32] attribut de classe

2006-08-22 Thread Mark Hammond
If I open twice the COM server, in the same application, when the first instance change the attr of class, the change is not visible from the second instance. When a COM attribute is set, Python does the equivalent of: setattr(instance, 'attr', 'value') So - even if you have: class

Re: [python-win32] Unexpected exception in gateway method 'AddTypeLib'with own Active Script Host

2006-08-26 Thread Mark Hammond
Could you try executing win32com\client\makepy.py as a script (eg, from a cmd-prompt), then select the typelib from the list that will be displayed, and see if it works there? According to the traceback, win32com believes it successfully generated the file, but then failed to locate it.

Re: [python-win32] ADO memory leak?

2006-08-26 Thread Mark Hammond
the total refcount increases by ~100k every time you run it. Now that we know where it is, shouldn't be too difficult to fix it. I'll take a close look at the C++ date conversion code tomorrow. Thanks Roger! I've reproduced the leak in the test suite (there were no tests for a 'datatime

Re: [python-win32] Memory Consumption when running Python COM Script

2006-08-28 Thread Mark Hammond
I have investigated this further and found that python appears to compile the Value call for each loop iteration (dynamic.py, row 300). The compiled python objects are somehow kept during the lifetime of the script. Is this correct? That is not expected. _make_method_ stores a copy of the

Re: [python-win32] PythonScript, unloading the Python engine

2006-08-28 Thread Mark Hammond
Hi, Is it possible to (forcibly) unload the python engine after executing a python script? Nope - Python has no facility for unloading extension modules, which means that repeated Inits and Terms in the same process tends to be problematic - and as a result we don't finalize at all. We used

Re: [python-win32] Exchange event

2006-09-04 Thread Mark Hammond
The only thing I can suggest is to ensure that both notifications come on the same thread. If 2 different threads call OnSave on the same object, thenself.InEmail will not be reliable (although it still isn't clear how that would cause an empty subject). From your code, it seems storing

Re: [python-win32] win32net

2006-09-08 Thread Mark Hammond
Try something like: import win32net win32net.NetGroupGetUsers(win32net.NetGetAnyDCName(), 'domain users', 1) Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Wolf, Matthias ALRT/ELD Sent: Thursday, 7 September 2006 11:55 PM To:

Re: [python-win32] isapi + IIS 6

2006-09-11 Thread Mark Hammond
what I try I cannot get the page to say anything other than This module has been imported 0 times. removeing the pyc's and or editing the .py seemed to have no effect. This was due to IIS6 providing unlimited length style filenames (eg, \\?\c:\etc) I've recently fixed that in the source

Re: [python-win32] creating a long-running Python COM server

2006-09-14 Thread Mark Hammond
Basically, you must: * Arrange for your process to be started * In your process, create a COM server object - ie, create an object with the _public_methods_ etc attributes, then use win32com.server.wrap to wrap it * Call pythoncom.RegisterActiveObject passing it this object. That should be enough

Re: [python-win32] Pythonwin

2006-09-18 Thread Mark Hammond
The first issue is that the run script dialog doesn't appear- instead the file open dialog appears, and re-appears when closed. This happens whenever the python version is run - whether from normal Python or Movable Python. I can't repro this - if I start Pythonwin via that script, then

Re: [python-win32] Service: path to .py script

2006-09-19 Thread Mark Hammond
Is Y: a mappyed network drive? If so, the problem will be that the mapping does not exist for the service account (and if you are using LocalSystem, it will not be possible/sensible to add it) Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Gregor

Re: [python-win32] How to implement a COM interface (that is notpart

2006-09-21 Thread Mark Hammond
Thanks for your help -- I searched around some more and I think I have the basic idea down -- if you want to implement a COM interface, it should look something like this: That all looks correct! import win32com.server.util qnotify = win32com.server.util.wrap(Q()) Try adding

Re: [python-win32] How to implement a COM interface (that is notpart

2006-09-22 Thread Mark Hammond
Is the custom of passing an object that implements an interface as an argument to a COM function an unusual one? Yes - but you must be careful of threading rules - ie, you can *not* simply pass the pointer to a different thread that make the actual callback. I've searched for other COM

[python-win32] pywin32 build 210 released

2006-09-22 Thread Mark Hammond
Hi all, I've just released pywin32 build 210. As usual, lots of thanks go to Roger Upole who again contributed significant changes - the full change notes are at: https://sourceforge.net/project/shownotes.php?release_id=449591 Now that 2.5 has been released, you will also find a 2.6 package

Re: [python-win32] loading and unloading python24.dll in an embeddedsituation

2006-09-28 Thread Mark Hammond
So my question is, is there any way to get these dlls unloaded? Nope :( Python loads libraries for extension modules, but never unloads them. I'd suggest just never finalizing Python! Mark ___ Python-win32 mailing list Python-win32@python.org

Re: [python-win32] Input-only vs. In/Out Function Parameters

2006-10-04 Thread Mark Hammond
2) VBA was giving me an error like Expecting 3 return values, got: 2 whenever a function contained an [in, out] parameter. It looks like the extra parameter it is looking for is the HRESULT signifying the success of There should be no need to return a HRESULT - but note that the nominated

Re: [python-win32] Flicker and OnEraseBkgnd

2006-10-09 Thread Mark Hammond
Hi, I currently try to add a matplotlib backend based on the Gecko engine (XPCOM, plugin), PIL and pywin. I simply build a new window and place it in the plugin area as a child. All works fine, bur when I change the size of the window, there is a flicker . I 've read some pages on the

Re: [python-win32] Python.AXScript (win32com) in Netstumbler

2006-10-12 Thread Mark Hammond
Now, I do the same in Python.AXScript: def OnScanResult(SSID,BSSID,CapFlags,Signal,Noise,LastSeen): PlaySound(ns-signal-1.wav) And it says PlaySound not defined. Of course there is winsound.PlaySound. PlaySound will be a method on a global object. Due to the way Python works, it is

Re: [python-win32] How to get PID from a Proces Handle ?

2006-10-12 Thread Mark Hammond
I have some code that spawns processes using the spawnv command this returns a process handle. Can I use the process handle to retrieve the actual PID of the process ? This is part of a test harness and I need to be able have the actual PID to use against some output. Good question! It's

Re: [python-win32] Python.AXScript (win32com) in Netstumbler

2006-10-12 Thread Mark Hammond
So, NetStumbler will call NetStumbler.OnScanResult on some events. I want to override that: Try: def NetStumbler_OnScanResult(SSID,BSSID,CapFlags,Signal,Noise,LastSeen): ... I think the above is similar to VBScript - at least it was when the AXScript support was written :) Mark

Re: [python-win32] We cannot import win32api into the Poser6 Python.

2006-10-16 Thread Mark Hammond
In POSER 4 we installed py152_python152.exe and win32all-143.exe So we can import the module win32api and write directly in a Excel sheet. This is very import for us. ... We have installed: Python-2.2.3.exe and pywin32-210.win32-py2.2.exe. We think that the problem is in the library

Re: [python-win32] What is Variant VT_UI1 in Python?

2006-10-16 Thread Mark Hammond
Hello, I'm having difficulty passing a VT_UI1 to a COM object. I've tried passing a list/tuple of bytes but it's raising an exception. When I pass a buffer, there is no exception but the returned IAutoLogPacket is None. What is an array of bytes? Here is the makepy generated method (I'm

Re: [python-win32] HTTP Error 500

2006-10-16 Thread Mark Hammond
Hi everyone. I'm getting quite desperate here - trying to run PythonScripts on asp pages. The problem seems to be in coding. This is XP Pro running IIS. Python 2.5 is installed (lates binary build), egenix mx package too and pywin32-210.win32-py2.5.exe (tried 209.1 too with the same

Re: [python-win32] Symbolic links/junctions in windows

2006-10-23 Thread Mark Hammond
Once AD has given you the path name, you can use the win32com.shell module to manage the shortcuts. Check out the pywin32 help file - the main page has a link to "win32com.shell and Windows Shell Links" with some info - also look in the win32comext\shell directory for tests and samples.

Re: [python-win32] Parameterless propget in Python ActiveScriptincomplete

2006-10-29 Thread Mark Hammond
Could you please open a bug at sourceforge so this doesn't get lost, as I'm afraid I don't have time right now to look at this... Thanks, Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Johan Lindvall Sent: Friday, 27 October 2006 8:00 PM To:

Re: [python-win32] win32pdh problem on Windows Server 2003

2006-10-31 Thread Mark Hammond
Also, the names are localized, so if you have a non-english version of Windows, you have to look up what are the translated names. (I don't know how to obtain a neutral name usable everywhere) Although it is far from perfect, the find_pdh_counter_localized_name() function in win32pdhutil does

Re: [python-win32] OnItemSend cancel help

2006-11-09 Thread Mark Hammond
In general, you should simply return the value of that variable. You didn't include the next line of the makepy snippet which includes the types, but a possibility is that the event handler is actually a function rather than a "sub" - so maybe something like: return 0, True should be

Re: [python-win32] how to get the interface of an COM object?

2006-11-13 Thread Mark Hammond
I googled the web and find some old posts in this maillist, it seems that only interfaces inherit from IDispatch can be used by pythonCOM, and interfaces here inherits from IUnknown. But I just need to use these interfaces, so could anybody tell me how to do it? I'm afraid that what you

Re: [python-win32] Building from Source

2006-11-14 Thread Mark Hammond
Hi Michael, raise RuntimeError, Can't find a version in Windows.h RuntimeError: Can't find a version in Windows.h I've no idea why that would happen unless the Windows.h we found isn't the correct one - no one else has ever reported it before. All I can suggest is to add some 'print'

Re: [python-win32] passing image as string/stream from python to vb

2006-11-19 Thread Mark Hammond
It may be that the Unicode characters used by COM are to blame. From the Python side of the world, try returning 'buffer(ob.getvalue())' - Python will try and return a buffer object as an array of characters, rather than a 'string' (which is Unicode). The end result is to try and ensure that

Re: [python-win32] pythoncom multithread troubles

2006-11-27 Thread Mark Hammond
What I have tried: - Use DispatchEx instead of Dispatch: this works with other COM servers, like MS Word and Excel, but not with mine. Probalby has to do with the fact that they are local servers, whereas mine is inproc. - CoInitialize, CoInitializeEx with flags: no luck - using

Re: [python-win32] DDE problem

2006-12-04 Thread Mark Hammond
A bit more... The snippet runs in IDLE, but not PythonWin. Pythonwin itself uses DDE - try starting with /nodde on the command-line and see if that help. Mark ___ Python-win32 mailing list Python-win32@python.org

Re: [python-win32] How to take a snapshot of a specific control?

2006-12-11 Thread Mark Hammond
These lines all execute: dtwnd = win32gui.GetDesktopWindow() hdcSrc = win32gui.GetWindowDC(dtwnd) hdcDestH = win32ui.CreateDCFromHandle(dtwnd) The last line above is a problem - try something like hdcDestH = win32gui.GetDC(dtwnd) hdcDest = win32gui.CreateCompatibleDC(hdcSrc) hBitmap =

Re: [python-win32] PYTHONPATH and .pth files under Windows XP

2006-12-19 Thread Mark Hammond
PYTHONPATH and .pth files under Windows XP No matter what my PYTHONPATH is set to as a Enivorment Variable under Windows XP, the only time a .pth file is actually being read and used is when I dump it into my site-packages directory off my install location. A quick scan of

Re: [python-win32] Displaying contents of a file using PyWin

2006-12-21 Thread Mark Hammond
Hi Gabriel, [Forwarded from [EMAIL PROTECTED] At Thursday 21/12/2006 13:51, MiguelS wrote: import win32ui from pywin.mfc import docview t = docview.DocTemplate() t.OpenDocumentFile(d:/temp/music.log, True) This caused windows to close PythonWin. This appears to be a problem with

Re: [python-win32] win32com: Problem with passing short integer?

2007-01-09 Thread Mark Hammond
The interface code is generated automatically in the 'gen_py' folder, the interface contains only vtable-entries, I am not sure what this means It almost certainly means that interface does not work with IDispatch - it is vtable only. pywin32 can't call such interfaces yet - I belive

Re: [python-win32] MemoryError: CreatingSafeArray when trying touse VBCOM API

2007-01-10 Thread Mark Hammond
if I do: s = win32com.client.Record(myStruct, o) s.myString = test s.myInt = 12 o.myFunct(arg1=(test,test), arg2=1, arg3=s) it then complains: TypeError: Objects for SAFEARRAYS must be sequences (of sequences), or a buffer object. In your original mail, you indicated the makepy

Re: [python-win32] MS Agent Event Handling via Python

2007-01-14 Thread Mark Hammond
Try changing your idle loop from: while 1: time.sleep(0.2) to: while 1: pythoncom.PumpWaitingMessages() time.sleep(0.2) (possibly importing pythoncom first). Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of ÎÄÁú Sent:

Re: [python-win32] subtree problem with ReadDirectoryChangesW

2007-01-14 Thread Mark Hammond
Check out win32\test\test_win32file - it has a test for that function, including some comments about using it with threads. The short version is that you don't sleep - just call ReadDirectoryChangesW - it will return when a change happens. The result is that the api works good only if the

Re: [python-win32] How to restart the shell?

2007-01-15 Thread Mark Hammond
I'm just trying out PythonWin 2.5, and can't figure out how to restart, or refresh the shell. Is there a way? It depends on what you mean exactly by refresh. The SHChangeNotify function can often be used to tell the shell about a change and its views will refresh accordingly. What exactly are

Re: [python-win32] Building with VC8

2007-01-18 Thread Mark Hammond
I tried building with Visual Studio 2005 (which uses the VC8 compiler line) and distutils reports that it cannot find a compiler. Right. It looks like distutils still just supports only the version used to build Python itself - and no official Python releases use vc8. Where should I go to

Re: [python-win32] wrapping objects from a COM server

2007-01-23 Thread Mark Hammond
Is there a way that I can automatically have this happen for me, so that `win32com.server.util.wrap` will automatically be called on the way out of a method? It should be possible to have your _dynamic_ method do this for you? Instead of returning the result item, introspect what is returned

Re: [python-win32] wrapping objects from a COM server

2007-01-23 Thread Mark Hammond
Mark Hammond wrote: Is there a way that I can automatically have this happen for me, so that `win32com.server.util.wrap` will automatically be called on the way out of a method? It should be possible to have your _dynamic_ method do this for you? Instead of returning the result item

Re: [python-win32] how to generate an IPersistStream object?

2007-01-29 Thread Mark Hammond
i need to pass an IPersistStream object to a COM function, and i find a type named PyIPersistStream in the manual of pywin32. but i don't know how to generate a PyIPersistStream object and pass it to the function. anyone could help me? Gabriel is completely correct - see

Re: [python-win32] how to generate an IPersistStream object?

2007-01-29 Thread Mark Hammond
On 1/30/07, Mark Hammond [EMAIL PROTECTED] wrote: i need to pass an IPersistStream object to a COM function, and i find a type named PyIPersistStream in the manual of pywin32. but i don't know how to generate a PyIPersistStream object and pass it to the function. anyone could

Re: [python-win32] iTunes COM using Python win32

2007-02-01 Thread Mark Hammond
I'd guess that one box has had makepy run for that type-library, but the other hasn't. Look into using the win32com.client.gencache module to programatically generate makepy support, and it should then happen everywhere you run it. HTH, Mark -Original Message- From: [EMAIL

Re: [python-win32] question about DynamicPolicy.py

2007-02-04 Thread Mark Hammond
That's correct - it is no longer necessary to convert unicode to ascii for pywin32's sake. You may have other reasons to perform either that conversion or a completely different conversion, but again, not because pywin32 insists. Cheers, Mark -Original Message- From: [EMAIL

Re: [python-win32] Recovering from AODB Exceptions, possible?

2007-02-09 Thread Mark Hammond
So I have a function that ries to add a record: def EntryAdd(self, dataDict): try: self._DBConn.MoveFirst() self._DBConn.AddNew() for key, value in dataDict.items(): self._DBConn.Fields.Item(key).Value = value

Re: [python-win32] better way to get current process's name

2007-02-22 Thread Mark Hammond
is there an easier way to get the name of current process? It depends on what you mean by 'name'. Either 'sys.executable' or 'win32api.GetModuleFileName(0)' should give the same(-ish) result as Tim's script in most cases. Mark ___ Python-win32

Re: [python-win32] COM: change in Python object does not get registered

2007-03-04 Thread Mark Hammond
I am completely new to COM and have trouble getting changes in python code be passed to the COM interface. When I apply changes to a Python class which is exposed as a COM object, these changes somehow don't get registered correctly - meaning that I cannot see the changes when accessing the

Re: [python-win32] suggested change to pywintypes.py for non-admininstall

2007-03-08 Thread Mark Hammond
Mark and others, For a non-admin install pywintypesXY.dll and pythoncomXY.dll cannot be put in the system directory. The typical alternative is to put them in the install dir, next to python.exe. pywintypes.py is setup to know how to find it when doing either of: import pywintypes

Re: [python-win32] Drag and Drop from Outlook

2007-03-13 Thread Mark Hammond
I am trying to make my application accepting drag and drop emails from Outlook. I was told on the wxPython mailing list to try to use win32com, but actually I have no idea which clipboard data format an Outlook email has. I have tried to set up a custom drop target for that: class

Re: [python-win32] Can't post to the list- who is the admin?

2007-03-13 Thread Mark Hammond
I've been trying to post messages for a few days now- I keep getting replies telling me my messages are being held. I've verified that I am subscribed with this address, and I did not post the messages to the sub/ubsub address. Who is the admin? I believe the admin is Itamar

Re: [python-win32] win32con

2007-03-13 Thread Mark Hammond
Is it an oversight that the win32con module is not listed in the PythonWin help- even as of 2.5 ? Yes. It is also a side-effect of the doc building process - as win32con has no autoduck markup it is skipped. It should be possible to generate docs for this module using the same technique we

Re: [python-win32] Scintilla Code Folding

2007-03-14 Thread Mark Hammond
Hi all, How is the code folding implemented in Python Win IDE? It uses the custom lexer for colorize but I can't see any code where the code folding logic is implemented. Is ii using the inbuilt SCILex_PYTHON for code folding? IIRC, the folding code is in C++ in the scintilla widget

Re: [python-win32] COM works from IDLE but not when file executed from Windows Explorer

2007-03-14 Thread Mark Hammond
Installed: Python25, pywin32-210.win32-py2.5.exe Being new to COM, I have a simple question. When I execute the following code from within IDLE, I hear the mp3 file played out but when I run the file from Windows Explorer I get no sound (and no errors) ? I'm sure the answer is very simple

Re: [python-win32] MS Access: silent overflow failure

2007-03-22 Thread Mark Hammond
The small demo script below makes ADO calls to a Microsoft Access (Jet) database via win32com. But it fails in a potentially dangerous way; SELECT int * int; can return None with no warning if the result is large enough. This can also occur if one or both of the operands is a column

Re: [python-win32] access to attribute non-(full)-Ascii

2007-04-01 Thread Mark Hammond
From Python+PyWin32, when I want access to properties (attributes) containing some characters no-Ascii (e.g. letters with accents, or unicode characters), Python screech! I need this in bridges Python-Javascript (via ActiveScripting or via drive InternetExplorer.Application). When I

Re: [python-win32] How to figure out the COM object name?

2007-04-03 Thread Mark Hammond
Newbie question.. I am trying to connect to a COM object.. and I can't figure how to code it.. You really need to consult the documentation for the object itself. In Makepy the name of the COM object is: OTA COM 9.0 Type LIbrary (1.0) Try opening the file generated by makepy - if you

Re: [python-win32] How to figure out the COM object name?

2007-04-03 Thread Mark Hammond
# This CoClass is known by the name 'TDClient80.AmarillusHash.1' Is that my golden ticket? You tell us! :) But quite possibly. If that is the only occurance, it probably is. If there are others, you probably need to inspect the methods available to work out the correct one. Mark

Re: [python-win32] Event log exception reporting with services

2007-04-04 Thread Mark Hammond
I can't reproduce this. If I change win32\Demos\service\pipeTestService.py to raise an error in the SvcDoRun() function, after starting the service I see the exception in the event log. Were both 2.4 and 2.5 installed with admin rights? Mark -Original Message- From: [EMAIL PROTECTED]

Re: [python-win32] How to make a standalone MFC script?

2007-04-12 Thread Mark Hammond
I want to embed an ActiveX control in a program and I see that the webbrowser example works very well replacing the appropriate lines. However, the webbrowser example doesn't run outside of the Pythonwin environment, as many other examples. What would I need to do to make the webbrowser a

Re: [python-win32] How to use IExtractImage in python

2007-04-19 Thread Mark Hammond
I have been delving in to the process of adding support for IExtractImage to pythonwin. I have run makegw on the necessary files, added the resulting .cpp and .h files to com/win32comext/shell/src, added references in shell.cpp and setup.py, and now it seems all that is left to do is implement

<    1   2   3   4   5   6   7   8   9   >