Re: [python-win32] win32ui can't be found .. some places.

2006-02-06 Thread Mark Hammond
> Traceback (most recent call last): >File "CharmAnalysis05.py", line 24, in ? >File "ddeclient.pyc", line 6, in ? >File "pywin\mfc\object.pyc", line 3, in ? >File "win32ui.pyc", line 9, in ? >File "win32ui.pyc", line 7, in __load > ImportError: DLL load failed: The specified mo

Re: [python-win32] Is it possible to pump messages in thread?

2006-02-07 Thread Mark Hammond
> > I've a question about this code since it was necessary to create a second > event for the ie object even though the original object and it's event > should (I believe) be available. Am I doing something wrong here? By setting ie.event, you are adding a new attibute to the IDispatch wrapper pr

Re: [python-win32] Is it possible to pump messages in thread?

2006-02-07 Thread Mark Hammond
> Thanks, that clears things up a bit (I'm new to com and my > understanding is > rather tenuous) and I think I understand why this does not work. > The net of > what I think you are saying is that as a practical matter message running > the message pump in a thread has little effect since the mess

Re: [python-win32] Problem passing a VARIANT argument to a methodof aCOM object

2006-02-07 Thread Mark Hammond
> STDMETHODIMP CTTOrderSelector::AddTest(LPCSTR > lpProperty, VARIANT vValue) > > LPCSTR is not a valid COM type, but somehow it is > correctly handled in C#. The authors claim that their > C# client code has been tested and is known to work > correctly. I assume that the C# implementation is usin

Re: [python-win32] Problem passing a VARIANT argument to a methodof aCOM object

2006-02-09 Thread Mark Hammond
> I tried ctypes. AddTest *does* seem to work with > ctypes. > > The rest of my application is written using win32com. > Is it possible to use both win32com-dispatched COM > objects and ctype-com-created COM objects in the same > application, and have them interact with each other > safely and corr

Re: [python-win32] writing long integer values to Excel

2006-02-12 Thread Mark Hammond
> I got the impression from table 12-1 of "Python > Programming on Win32" that writing 3 *(10 **9) to > Excel would succeed, but it seems to overflow, while > writing 3.0 *(10 **9) succeeds. Is this standard > behavior, or perhaps a bug? Yes, it is a bug. I have fixed it here. As you noticed, a

Re: [python-win32] [Fwd: Re: Excel advanced find]

2006-02-15 Thread Mark Hammond
> > [code] > > from pythoncom import Missing > > usedRange = xlApp.ActiveSheet.UsedRange > > usedRange.Find('FXN3', Missing, constants.xlValues, > > constants.xlWhole, constants,xlByColumns, > > constants.xlNext, False, False, Missing) > > [/code] > > Whoa -- disrega

Re: [python-win32] saving an ole control object embedded in a powerpoint

2006-02-20 Thread Mark Hammond
> The problem is that I don't know how to obtain something that would be > accepted as an IStream (through python/com machinery) and that would > write everything to a file or in a string, and that I can read later. Look at the win32com.server.util FileStream class. Usage would be something like:

Re: [python-win32] Fresh excel session

2006-02-21 Thread Mark Hammond
> Hi, > I wrote a small app that is able to open a excel ssheet with > the win32com > module. My problem is that it opens the new excel in the current > excel session > ( if available ). Is there a way of opening a fresh new excel > session with the > following script and not interferate with my

Re: [python-win32] Makepy and Documentum Foundation Classes

2006-02-22 Thread Mark Hammond
> Unfortunately, the dynamic dispatch and makepy utilities don't get the > correct IDs for the various methods -- which are often object factories > that lead to more dispatches. I'm not sure what you mean by "dynamic dispatch", but if you explicitly use win32com.client.dynamic.DumpDispatch(), you

Re: [python-win32] ReadEventLog doesn't return, CPU usage increases

2006-03-02 Thread Mark Hammond
> The problem is that after the script has run from some time (usually several > hours), the call to ReadEventLog seems to hang and the CPU usage increases > dramatically (from nil to 30-50%). The script does not exit this stage, > and has to be broken manually with Ctrl-C. There is the possibil

Re: [python-win32] DispatchWithEvents and ADO

2006-03-08 Thread Mark Hammond
> include DispatchWithEvents both the Execute() and > Close() methods no longer work for my Dispatch object, > with a "Member not found" error appearing. Why does > Execute and Close work with Dispatch by itself but not > when DispatchWithEvents is added? > > What I find interesting is that both th

Re: [python-win32] DispatchWithEvents and ADO

2006-03-08 Thread Mark Hammond
Oops - that last mail snuck away from me! Enabling "debug mode" for event handlers is tricky - you probably could open the makepy generated file and locate the function in the events class: def _query_interface_(self, iid): import win32com.server.util if ii

Re: [python-win32] IE toolbar button in Python

2006-03-08 Thread Mark Hammond
> Roger Upole wrote: > > > > There's an IE toolbar button demo in CVS: > > > http://cvs.sourceforge.net/viewcvs.py/pywin32/pywin32/com/win32com > /demos/iebutton.py?rev=1.1&view=log > > > I looked at this, but can't figure out what to do with it. Are there any > instructions? What seems apparant is

Re: [python-win32] IE toolbar button in Python

2006-03-09 Thread Mark Hammond
> in traceutil, and then IE is crashing. Ahh, yes, it all comes back to me now - that is the problem that means you must wait for build 208 :( I'll try and do that early next week (I'm away for the weekend!) Mark ___ Python-win32 mailing list Python

Re: [python-win32] Casting to a specific interface

2006-03-09 Thread Mark Hammond
I'm afraid IMAPIStatus isn't exposed via pywin32 - depending on your patience, I could probably get it done within a week or so, maybe even in time for build 208 :)   Mark -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Amrit JassalSent: Friday

Re: [python-win32] Resize a control? How?

2006-03-13 Thread Mark Hammond
> But how on eatrh can I set new widths and heights of a control? Do I have > to re-create the control using CreateWindow? Isn't there another way? MoveWindow is the call you are after. Mark ___ Python-win32 mailing list Python-win32@python.org http:/

Re: [python-win32] Reading a UInt32 array from LabVIEW

2006-03-14 Thread Mark Hammond
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Ola Rylow > I'm accessing LabVIEW through the ActiveX interface and I'm having a problem with reading a UInt32 array. Support for VT_UI4 safe-arrays was added in pywin32 build 207, so you should try that. Note however that build 208

Re: [python-win32] GetKeyboardState - API not covered?

2006-03-15 Thread Mark Hammond
> I wonder if the goal of pywin32 is to have a comprenhensive interface to > win32 API, or if the API are implemented on as needed basis. Both :) I do try and keep it comprehensive (eg, by implementing a complete family of functions when possible), but the reality is that many API functions are n

Re: [python-win32] Pythoncom error

2006-03-15 Thread Mark Hammond
> Hello, > I'm stress testing an application I have written using the Python Asp > bindings, on occasions I get an ASP 0147 error (Internal Server > Error), In the IIS logs it manifests itself as a c005 trapable > error. That sounds like an Access Violation is happening - which probably is *no

Re: [python-win32] Pythoncom error

2006-03-16 Thread Mark Hammond
> Here's the thing; I took your advice and kept an eye out for errors > related to the debugger support and fixed them when I found them > (often with a just quick try except clause as you suggested, I'll > revisit them when I get time), Please do, and feed the changes you made back to me (even if

Re: [python-win32] problem w/ outlook scripting

2006-03-16 Thread Mark Hammond
Try ensuring all methods have parens - eg: > myDistList.Save > myDistList.Display May not have any effect without the trailing () to indicate a method call. Mark ___ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/list

Re: [python-win32] NT Service not re-startable after reboot

2006-03-16 Thread Mark Hammond
I'm afraid I've no idea. The first thing to check is that username configured to use the service, and check that the service does not rely on any network shares or similar. Most service problems relate to this (eg, trying to run a service from a mapped drive as the LocalSystem account doomed to f

[python-win32] pywin32 build 208

2006-03-19 Thread Mark Hammond
Hi all, I have just released build 208 of the pywin32 extensions. Change log and release notes: https://sourceforge.net/project/shownotes.php?release_id=403008 Download via: https://sourceforge.net/project/showfiles.php?group_id=78018 Please log any issues via the SourceForge bug collector:

Re: [python-win32] Reading a UInt32 array from LabVIEW

2006-03-22 Thread Mark Hammond
> I've tested build 208 with success. Just one exception: > When I try to read an array of unsigned 8bit integers I > get the following result: > () > What is special about UInt8 An array of UInt8 is the standard way of moving "blobs" around in variants (eg, raw buffers, etc). Hence we return the

Re: [python-win32] python com server exceptions don't make it to .NET /CLR app

2006-03-30 Thread Mark Hammond
> err = pythoncom.com_error(errorcode, desc, ierrorinfo, None) Try win32com.server.exception.COMException - the framework sees that exception as something that should be raised to the caller (whereas a normal pythoncom.com_exception is assumed to have been generated by a COM object *used* by t

Re: [python-win32] newbie problem with DispatchWithEvents

2006-04-03 Thread Mark Hammond
> I'm new to python and python-win32. > Need to use an instance of IE for a little work. > I'm trying looking at the examples found, but I'm encountering a > big problem > to proceed: > if I use win32com.client.Dispatch, all works fine, I can manipulate the IE > instance without problems. But I nee

Re: [python-win32] Importing an array from COM into Python

2006-04-04 Thread Mark Hammond
> I am trying to get the arrays out of this function (from the IDL): > > [id(175), helpstring("method CreateFooBarArray")] HRESULT > CreateFooBarArray([out]DOUBLE** FooArray, [out] DOUBLE** BarArray, > [out,retval] ULONG* SizeOfFooBarArrays); > > The two arrays (Foo and Bar) are created with malloc

Re: [python-win32] Runnin Python app as service with separate console

2006-04-05 Thread Mark Hammond
> I have a robust, stable Python script that runs 24-7, crunching a telnet > feed of real-time data. Problem is, it has to run in a dos console > window on the desktop. I would like to run it as a service, If it must run on the desktop of the logged in user, then this is not what services are for.

Re: [python-win32] Garbage collection of dispatched classes withdispatched classes

2006-04-05 Thread Mark Hammond
> Hi, I'm hoping someone might provide some COM dispatching > insights as I'm relatively new to it in Python. Does using static > binding provide for better garbage collection when the dispatched class > has dispatched classes of it's own? Nope - it should make no difference. > The nitty g

Re: [python-win32] Windows Service Parameters

2006-04-06 Thread Mark Hammond
> Hello, > Does anybody have an example of getting hold of the "start parameters" > in a Python windows service? > I was half expecting them to be passed to SvcDoRun but I can't see > that they are. Not an example - but they are passed to your service's __init__ function. Most of the examples don'

Re: [python-win32] WMI Performance API

2006-04-10 Thread Mark Hammond
> I want to use the WMI Performance API to collect performance > information from remote boxes. To do this I need to create a > WbemScripting. SWbemRefresher object like so: > > objRefresher = CreateObject("WbemScripting.SWbemRefresher") > > Is CreateObject something that is available from python

Re: [python-win32] Embed PyCWnd in Tkinter Frame?

2006-04-10 Thread Mark Hammond
> I've been searching for this all weekend and can't find > what I consider a straight answer. I have an existing Tkinter > app which automates IE but I'd really like to embed IE in a > Tkinter frame but don't want to have to completely re-write the > app. I see it appears fairly easy to ac

Re: [python-win32] Runnin Python app as service with separateconsole

2006-04-10 Thread Mark Hammond
> "install_3d_app_service.cpp" is a program to install > sftc3win.exe(sftc_3d_app_service.cpp) > into a Windows' service. Inside sftc_3d_app_service.cpp, it will spawn > "python". > After reboot the machine, no problem, everything works fine, please see > attached > picture python_running.JPG. The

Re: [python-win32] BSTR

2006-04-13 Thread Mark Hammond
> The question is, how to convert a String in a BSTR (unicodestring with > header)? Python will *always* (unless an object's typelib indicated otherwise) pass a VT_BSTR when a string literal is specified. I'm afraid I can't speculate on what the problem may otherwise be. Mark __

Re: [python-win32] python com and py2exe

2006-04-16 Thread Mark Hammond
Are you sure you need a COM .exe and not a COM .DLL? When you tested this using a .py implemented server, did you take steps to ensure that was only ever using a .exe COM object too? Otherwise, it would seem to be py2exe related - you will need to use the archives to find explanations I have give

Re: [python-win32] Problem with installer for pywin32 with Python 2.5

2006-04-16 Thread Mark Hammond
> Wise-installer versions, which are pretty old by now. Is there any > chance of a temporary version of the installer without the preinstall > script, just for use with the Python 2.5a1 release? I tried building > one for myself, but I'm missing some critical dependencies (dsound.h?) Done - see th

Re: [python-win32] BSTR

2006-04-17 Thread Mark Hammond
> I want to share a reply from the developer of MaxIm DL. > He installed Python2.4.3 and PythonWin build 208, > just to be able to reproduce this error and it looks to me > as if the bug could be inside PythonWin. Please forward this to him. > I expect Mark Hammond is far too busy

Re: [python-win32] Building pywin32 with the free MS toolkit compiler(Was: Problem with installer for pywin32 with Python 2.5)

2006-04-18 Thread Mark Hammond
> On 4/17/06, Paul Moore <[EMAIL PROTECTED]> wrote: > > On 4/16/06, Paul Moore <[EMAIL PROTECTED]> wrote: > > > I tried building one for myself, but I'm missing some critical > > > dependencies (dsound.h?) > > > > I'm assuming this is from the DirectX SDK, which I'm in the process of > > downloadin

Re: [python-win32] wrong results in service running mode

2006-04-19 Thread Mark Hammond
> One piece of the program is to check a file exist or not as follows: > > szNormPath= os.path.normpath(strFileName) > nRetCode = os.access(szNormPath, os.F_OK) > # nRetCode = os.path.exists(szNormPath) > > When the file path is C:\shared\t.txt, no problem. > When the pat

Re: [python-win32] Simple questions aboutwin32pdhutil.GetPerformanceAttributes

2006-04-26 Thread Mark Hammond
Please see the comments in win32pdhutil.GetPerformanceAttributes - they explain that many attributes, particularly the processor ones, require 2 samples to give reasonable results.   The comment says:    # NOTE: Many counters require 2 samples to give accurate results, # including "% Proces

Re: [python-win32] Referencing SimpleCOMServer-based COM object fromVisStudio C# code?

2006-04-28 Thread Mark Hammond
> I am trying to access my python class, implemented as a COM server, > from my Visual Studio C# application. The problem is when I try to add > a reference with Visual Studio, my COM object isn't listed. > > When I run PythonWin and use its COM Browser tool, my COM object is in > one of the "regis

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

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 i

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 att

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

Re: [python-win32] Problem to call COM-dynamic-server

2006-05-08 Thread Mark Hammond
I'm afraid that without working code I can only guess... > Here, a traceback : > > pythoncom error: Python error invoking COM method. > > exceptions.TypeError: Objects of type 'instancemethod' can not be > converted > to a > COM VARIANT > Traceback (most recent call last): > File "D:\dev\python

Re: [python-win32] Problem to call COM-dynamic-server

2006-05-08 Thread Mark Hammond
> >>> Please post the complete source for the *smallest possible* > >>> server and client that demonstrates your problem... > > OK. > But my original source has more than 7000 lines. > That will take a certain time (that is added to my work). Welcome to my world! :) > For info, the call of the i

Re: [python-win32] Getting localized account name from RID

2006-05-09 Thread Mark Hammond
Hi Sid, > I need to get the localized account name for "BUILTIN\Users", which > afaict maps to ntsecuritycon.DOMAIN_ALIAS_RID_USERS. But, given that, > how do I get from the RID to the SID? (or to the account name which is > what I want anyway). > > I've found the following article, but my C is no

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 hav

Re: [python-win32] Outlook Addin Help

2006-05-11 Thread Mark Hammond
> I've created an addin derived from the example in the ..\win32com\demos > directory (outlookAddin.py). I've also taken a look at the source code > for the SpamBayes addin. > > The addin works, but I get an error from Outlook when I close Outlook > and then *immediately* try and restart it. The er

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 (appar

Re: [python-win32] Building pywin32 with the free MS toolkit

2006-05-18 Thread Mark Hammond
> Mark, it appears this checkin got lost somewhere in SF's upgrade > shuffle. A clean checkout from the new CVS host doesn't show > these changes any more. Could you commit those again ? Oops - it looks like the previous commit failed and I didn't notice! It *is* checked in now (and I checked i

Re: [python-win32] Rewriting my previous question....

2006-05-21 Thread Mark Hammond
> I'll rewrite my previous question... > > How do I get data from another process using win32gui.SendMessage() > when it needs some pointers to fill in the data? It appears your previous mails indicated how to do that. Unfortunately, some of those functions are not exposed via pywin32. Cheers,

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

Re: [python-win32] Getting pywin32 build number

2006-05-25 Thread Mark Hammond
> I support Justin's request: the pywin32.version.txt has been a big step > forward, but it is still not easy to get this information (in a reliable > way) from within user code. Python packages usually provide a > __version__ variable in their __init__.py. pywin32 has a few __init__.py files, and

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 my

Re: [python-win32] problem with reference parameter to COM function(makepy)

2006-06-05 Thread Mark Hammond
> I'm trying to use win32com to drive a COM object. I ran makepy to > create the interface and am (apparently) able to run some of the > object's functions. I'm having problem, though, with functions that > have reference parameters (e.g., pointer to bool). > > I saw in some documentation (on

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 pythonwin/wi

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

Re: [python-win32] Unit testing COM clients and Servers

2006-06-18 Thread Mark Hammond
> I'm fairly new to it and it seems like to write tests, you have to > simulate the responses ADSI or WMI. I can find lots of help doing > standard python unit testing but how does this change when using COM? The only advice I can offer is to not think of this as a COM problem. All apps that talk

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] Is pure-win32 GetWindowPlacement() available ?

2006-06-22 Thread Mark Hammond
> I have been looking for a wrapper for the Win32 function > GetWindowPlacement() but could not find it in the latest version of > Python for Windows extension (version 208). I saw a reference to > PyCWnd.GetWindowPlacement() where a MFC CWnd is needed but could not > find a pure Win32 version. >

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 g

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

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

2006-06-30 Thread Mark Hammond
> I thought I would be able to do > > my_string = unicode(Request("formstring"),"ISO-8859-1") > > But i get: > coercing to Unicode: need string or buffer, instance found. > I'm guessing (and I mean guessing) this is because the CDispatch > object doesn't have a __unicode__ function. A __unicode__

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

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

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

2006-07-04 Thread Mark Hammond
Sorry for the delay: > VI.ShowFPOnCall = True > VI.Call(ParamNames, ParamVals) > print ParamVals[1] Before the failing Call, try adding: VI._FlagAsMethod("Call") _FlagAsMethod is a helper method inside these dynamic objects and will help work-around COM objects that don't differentiate property

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

2006-07-05 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

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 loc

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:

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 fac

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

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 <>___ Python-w

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

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

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.

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 communicat

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

2006-08-02 Thread Mark Hammond
> I've been trying to solve a small but disturbing problem with > win32com, but I can't. > It's the "OLE Server Busy" problem [1]: > "If you call a method on a COM server from an MFC COM client > application and if the method takes a long time to process and return > back, you won't be able to do a

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

2006-08-02 Thread Mark Hammond
> When I run this, I get the following error: > > Traceback (most recent call last): > File "C:\Program > Files\Python24\Lib\site-packages\pythonwin\pywin\framework\scr > iptutils.py", > line 310, in RunScript > exec codeObject in __main__.__dict__ > File "C:\Documents and Settings\benn\D

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 h

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

2006-08-04 Thread Mark Hammond
> Ah good point, I put back in the brackets (doh!) and I am now back to > the previous place: > > mod = > gencache.EnsureModule('{A4818FD5-6479-11D4-8452-00104B92DD56}', 0, > 1, 0) > print dir(mod) > ob = mod.Application() > print dir(ob) > objCybio = win32com.client.DispatchWithEvents(ob, CybioEve

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 wh

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 ex

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 cal

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: clas

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

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] Memory Consumption when running Python COM Script

2006-08-28 Thread Mark Hammond
> > That is not expected. _make_method_ stores a copy of the method in > > self._builtMethods_ (line 309). A further __getattr__ for > that name should > > locate it. You may have found a 'bug' (or maybe it should > be called an > > un-optimization) when the default method name is used > though

Re: [python-win32] I do not manage to call methods in automated objectssince InvokeTypes() fails

2006-08-28 Thread Mark Hammond
> I am trying to write a client application that uses our com server > (automated) interface. > Usually VB scripts or C++ programs provide these client applications. > I use early binding by running makepy. > I manage to access all propertied, yet do not manage to call methods. > The InvokeTypes()

<    3   4   5   6   7   8   9   10   11   12   >