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 us

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, then self.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-07 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: python-win32@py

Re: [python-win32] isapi + django

2006-09-08 Thread Mark Hammond
Hi Robin, > I thought I'd check here in case anyone has already connected > django to IIS. > > > I tried the PyISAPIe, but it doesn't do what django needs and > I guess I should > have looked around at win32 before doing that. > > It seems the isapi stuff will do what I want and there's > already

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

Re: [python-win32] isapi + IIS 6

2006-09-12 Thread Mark Hammond
> Anyhow, I guess the main problem will be figuring out what to > do about the extra > "Web Services Extension" tab in IIS 6. Strangely I think that > filters work > without extra complication, but an extension needs an extra > step ie entering and > enabling in the WSE list. Can you please try wi

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] creating a long-running Python COM server

2006-09-17 Thread Mark Hammond
> I will write this up as a recipe in the Python Cookbook; any comments > on my code (attached)? The 'busy loop' looks ugly to my eyes. It can be solved by importing win32gui, then changing the Quit method to: def Quit(self): win32gui.PostQuitMessage(0) and the entire busy loop gets

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 Gre

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 useDispa

Re: [python-win32] Newbie question

2006-09-22 Thread Mark Hammond
> Hello, I don't really have experience using win32com and I'm > running into a problem. I'm trying to use a COM object. > Several of the functions take strings as arguments, but when > I pass in a string I get an exception: ... > > The documentation claims that the argument is a pointer to a

Re: [python-win32] Setting string properties

2006-09-22 Thread Mark Hammond
The only thing I can notice is: > AttributeError: ' Objects).IPanScriptTFOSlice instance at 0x11496344>' object has no > attribute 'Value' ... > class IPanScriptTFOSlice2(DispatchBaseClass): > """PanScript TFO Slice.""" > CLSID = IID('{6BA870D0-055A-11D4-ABE3-00C04F9D382F}') ... Note that

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 f

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

Re: [python-win32] pywin32 build 210 released

2006-09-26 Thread Mark Hammond
> version for 2.4 installs file: > > pywin32-210-py2.6.egg-info > > IAUC it must be py2.4.egg? Hrmph - I never asked for *any* egg file to be created. I'm guessing that the simple fact I previously installed setuptools caused this side-effect. I'll try and remember to dig deeper before the next r

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

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 page

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

2006-10-11 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,

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! I

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 pyth

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 met

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] killProcName kinda slow

2006-10-18 Thread Mark Hammond
> I am trying to use the killProcName function in a project, and it does > work, but it is kinda slow. > > Just running it alone has the same effect > > > C:\>killProcName.py notepad > (wait for about 30 seconds) > Killed notepad > > > Is there any way to do this faster? Or is there another functi

Re: [python-win32] Win32com , how select coclass interface?

2006-10-18 Thread Mark Hammond
> I have a DLL that have several interfaces accociated > with a CoClass, but there is one default interface. > > snip from my genpy generated .py file: > -- > from win32com.client import CoClassBaseClass > # This CoClass is known by the name > 'BK.BasicEnv.Application.Re

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

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

2006-10-23 Thread Mark Hammond
> But I guess it would be better for my scripts (create_user, > modify_users, delete_users) if they could just call the win32 > api instead of using os.popen(). > Is there a way to accomplish this ? If pywin32 exposes the functions you need, then sure, you can call them! I assume you are look

Re: [python-win32] Capturing stdout when running a Python Script

2006-10-29 Thread Mark Hammond
> I am afraid my orginal post was a bit unclear. I am looking for a way > to capture script output running in an ActiveScript Python host. I'm afraid that is not possible - some script code will need to perform that redirection for you, and that might need to happen for each script - the axscript

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] Input-only vs. In/Out Function Parameters

2006-10-30 Thread Mark Hammond
> ... > if type(retVal) == types.TupleType: # Like pythoncom, we special case a tuple. > # However, if they want to return a specific HRESULT, > # then they have to return all of the out arguments > # AND the HRESULT. > if len(retVal) == len(meth._gw_out_args

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 d

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 go

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' s

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 'ima

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 C

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 http://mail.python.org/mailman/li

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] Register COM Server for all users

2006-12-12 Thread Mark Hammond
> I'm doing some work on a simple Python COM server to wrap a > SOAP client on a machine. It is going well and I have it working > however when I attempt to register the python COM servers > they are only > registered in the current user namespace and not the all > users namespace > (HKE

Re: [python-win32] Client side COM and Python Problem

2006-12-13 Thread Mark Hammond
> #code > import win32com.client > o = win32com.client.Dispatch("MAX.Application.8") > o.mypingmax("test string") > > # Python Error > > Traceback (most recent call last): > File "", line 1, in ? > File > "C:\Python24\lib\site-packages\win32com\client\dynamic.py", line > 491, in __getattr__ >

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 http://docs.

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

Re: [python-win32] Dispatch error 'CoInitialize has not been called'

2007-01-01 Thread Mark Hammond
Another random comment re CoInitialize in servers... Depending on your requirements, you may be better off with: try: pythoncom.CoInitializeEx(pythoncom.COINIT_MULTITHREADED) except pythoncom.com_error: # already initialized. pass (and as per Roger's comments, adding a flag to handle CoUni

Re: [python-win32] Python hangs on exit after failed IIS GetObject call

2007-01-02 Thread Mark Hammond
> I'm seeing Python hang on exit after a failed IIS GetObject() call, > similar to what is described at > http://mail.python.org/pipermail/python-win32/2005-October/003819.html. > For instance, the code > import win32com.client > import pywintypes > try: > testobj=win32com.client.GetObject("II

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 comt

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

2007-01-09 Thread Mark Hammond
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Rex Corrovan > Sent: Wednesday, 10 January 2007 7:54 AM > To: python-win32@python.org > Subject: [python-win32] MemoryError: CreatingSafeArray when trying to > use VBCOM API > > > I have a VB COM App I am

Re: [python-win32] win32ui and resources for dialogs

2007-01-10 Thread Mark Hammond
> i tried to add this to the source of python-win32 > but i refuses to compile with some link issue What issue is that? I'd like for pywin32 to build without too much effort - and at least fail gracefully when it doesn't. As Niki says, avoiding MFC is a good idea. You should also find win32gui

Re: [python-win32] win32ui and resources for dialogs

2007-01-10 Thread Mark Hammond
> Hi Mark > > I made the following change: > > > --- > // @pymethod |PyCDialog|CreateWindow|Create a modeless window for the > dialog box. > static PyObject *ui_dialog_create_window( PyObject *self, > PyObject *args ) > { > AFX_MANAGE_STATE(AfxGetStaticModuleState()); > >

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

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

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 chang

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

Re: [python-win32] [pywin32-bugs] Build problem with VC++ 2005

2007-01-18 Thread Mark Hammond
The [EMAIL PROTECTED] mailing list is only for automated mails from the sourceforge bug tracker. The best list for this stuff is [EMAIL PROTECTED] Please drop pywin32-bugs from any followups.. Note that in general, you *must* use the same compiler for extensions that you use for Python itself.

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 t

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

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

2007-01-24 Thread Mark Hammond
> >> Well, thats basically what I am doing now, but these object > >> structures that are returned can be arbitrarily complex, with lists > >> of objects that contain other kinds of objects, which have lists > >> of even more objects. Having to walk through arbitrary object > >> structures and loo

Re: [python-win32] C++ problem (was rebuilding 210 with VC8 woes)

2007-01-28 Thread Mark Hammond
I'm afraid that compile error doesn't ring any bells with me, and I've no copy of VC8 handy to verify your error with. > "Howard Lightstone" <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > > While trying to rebuild pywin32 using VC8 (after a couple > of distutils > > patches...), I have

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 ./win32com/dem

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 PyIPersis

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

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 PROTECTED

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] win32com confusion: PROPERTY with arguments vs.METHOD.

2007-02-11 Thread Mark Hammond
If you can use makepy on your object, you should find 'SetRegister(args)' works. Sadly, this isn't supported in objects without typelib support. I've added the bones of this to the test suite, so let me know if you'd like to help work on this... Cheers, Mark > -Original Message- > From:

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 maili

Re: [python-win32] DynamicProxies for VBA

2007-02-26 Thread Mark Hammond
I'mn afraid you need to read through the _dynamic_ implementation to see how things work. The COM object must list the public methods and attributes in _public_methods_ etc before they will be exposed to COM - which is necessary to ensure the COM semantics are implemented by Python. VB knows only

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 t

Re: [python-win32] send function handler to COM/Jscript ?

2007-03-07 Thread Mark Hammond
> I drive Internet-Explorer, with win32com.client.Dispatch > > It's run very well. > Among other things, I can "attach" (with =) jscript function > (content in > HTML page) to a Python object, callable, and I use it, in > Python's script > (like a Python function). ... > Somebody has a track of so

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

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

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

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 u

Re: [python-win32] How to detect User pressing escape, or clicking cancel in call to win32gui.GetOpenFileNameW()

2007-03-13 Thread Mark Hammond
> I'm trying to understand how to detect a user pressing Escape, or > clicking on Cancel when win32gui.GetOpenFileNameW() is called. > > When I press escape when the FileOpen dialogue is present, I see the > following error with Python2.5/PWin32 Build 210 > > error: (0, 'GetOpenFileNameW', 'No erro

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 wid

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

Re: [python-win32] Scintilla Code Folding

2007-03-14 Thread Mark Hammond
nswer. Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Nawal Sent: Thursday, 15 March 2007 4:23 PM To: Mark Hammond Cc: Python-win32@python.org Subject: Re: [python-win32] Scintilla Code Folding Dear Mark, Thank you for the reply.

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

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 -

Re: [python-win32] Win32 service with tray icon

2007-04-03 Thread Mark Hammond
> I'm writing a win32 service in Python. I'd like to add a > tray icon displayed > whenever the service is running. I have played around with > SysTrayIcon.py > [1], but if a user logs off and logs back on, the tray icon > disappears even > though the service is still running. I think the answer

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

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

2007-04-18 Thread Mark Hammond
I'm afraid that IExtractImage is not yet exposed by pywin32 - it would not be too hard if you are interested in testing a new implementation. Note that IExtractIcon is exposed - that may nor may-not work for you though. Cheers, Mark -Original Message- From: [EMAIL PROTECTED] [mailto:

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 implem

Re: [python-win32] VT_UI1 ByRef behavior

2007-04-29 Thread Mark Hammond
> I was curious is there a way to prevent an array of VT_UI1's from being > converted to a buffer? Or perhaps a way to modify the file generated > from "makepy" to prevent the conversion? Nope, no such facility exists. Feel free to propose a patch though. Cheers, Mark ___

Re: [python-win32] Registering a Server COM to make it visible in thereference list

2007-04-29 Thread Mark Hammond
> > I have made a COM server using python and > registered it using > win32com.server.register.UseCommandLine(TrackingClient). > That all works > fine and I can instantiate it using late binding, however I > now need to > reference that in C# or VBA in excel. The problem I have is > that

Re: [python-win32] Registering a Server COM to make it visibleinthereference list

2007-04-29 Thread Mark Hammond
> Because dynamic COM server is a very interesting feature, I > think than a > external (optional) tool for generate TLB is better than the > auto-create way. Yeah - it would only be done when explicitly enabled, but the generation of the typelib itself should be as automatic as possible. If a de

Re: [python-win32] Running CherryPy inside IIS

2007-05-01 Thread Mark Hammond
You almost certainly do not want to do this via ASP. Look at the isapi module that comes with pywin32 for a much lower-level interface into IIS. Cheers, Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Paul Johnston Sent: Wednesday, 2 May 2007 2:0

Re: [python-win32] Fw: Python COM and Photoshop

2007-05-07 Thread Mark Hammond
> > F:\automation>test2.py > > [(1, 1), (1, 2), (2, 2), (2, 1)] > > Traceback (most recent call last): > > File "F:\automation\test2.py", line 19, in ? > > doc.Selection.Select(selregion,1,0,0) > > File ">", line 3, in Select > > pywintypes.com_error: (-2147352567, 'Exception occurred.', >

Re: [python-win32] PyTime

2007-05-08 Thread Mark Hammond
> I have an Excel file with many dates beyond 2038, which arrive to me as a list of PyTime objects. > From the doc I have found ( http://aspn.activestate.com/ASPN/docs/ActivePython/2.4/pywin32/PyTime.html ) > it appears that an int conversion is needed to handle them. To answer Mark's question fir

Re: [python-win32] how to create a valid Sink

2007-05-09 Thread Mark Hammond
> I'd like to ask for help on how to create a valid event Sink > which I can > pass to the Advise() method of a message stores table. This might be tricky unless pywin32 already has support for the specific interface you need. > Any class I made up so far gives the same error: > > File "", line 3

Re: [python-win32] how to create a valid Sink

2007-05-09 Thread Mark Hammond
> Forgive my ignorance but those are my first steps with com. Does that > mean I should create and register a COM server? You should create one - you probably don't need to register it. > Basically I'm trying to reimplement the following code in python: > > http://www.codeproject.com/internet/CMa

Re: [python-win32] terminateprocess, getprocessid and compiling trunk on win32

2007-05-10 Thread Mark Hammond
> i'm currently building a multi-platform renderfarm application, and > would need to use GetProcessId to circumvant problems i encounter when > i try to kill processes on win32 > > IE: i can't kill with TerminateProcess a process i spawned with > CreateProcess (getting a Acess Denied error), but i

Re: [python-win32] HookMessage fails

2007-05-15 Thread Mark Hammond
> > I don't see the parent being passed into the dialogs in pywin32's > > sample code. Is this going to be a problem? > > Well, in looking at the code, I don't even see a way to > specify one, so > this seems to have been a rat hole. > > I'm mildly surprised by that. The CreateDialog APIs all take

Re: [python-win32] HookMessage fails

2007-05-15 Thread Mark Hammond
> > This is the magic of MFC - if no parent is specified, the > "main window" for > > the application is automatically used. > > > > Isn't that the issue, then? He's writing a dialog to plug in to > Explorer, and every time he runs, there's a different "main window". > MFC gets its concept of a "m

Re: [python-win32] terminateprocess, getprocessid and compiling trunk on win32

2007-05-15 Thread Mark Hammond
These appear to be a reposts of the message you sent on May 11, which I also answered on that same day (notwithstanding time zones!) Mark > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Benjamin Deboute > Sent: Thursday, 10 May 2007 5:56 PM > To: pytho

Re: [python-win32] translating VB into Python...

2007-05-16 Thread Mark Hammond
> I'm hoping that Mark Hammond will catch sight > of this thread and chip in. I'm guessing that > you're seeing some odd interaction between > the generated class/module and the COM object > properties. There's a sort of funniness where > properties can

<    4   5   6   7   8   9   10   11   12   >