From ful_tom@yahoo.com Thu Mar 6 14:08:01 2003 From: ful_tom@yahoo.com (Tom) Date: Thu, 6 Mar 2003 06:08:01 -0800 (PST) Subject: [python-win32] Excel2000 and password Message-ID: <20030306140801.96419.qmail@web20902.mail.yahoo.com> Hello, I have a problem with opening a password protected xls document. When program runs, a Excel dialog prompt for password is always displayed. Here is a code: self.xlApp = win32com.client.Dispatch('Excel.Application') self.xlBook = self.xlApp.Workbooks.Open(filename, Password="Mypasswd") What's wrong? A parameter name Password is correct. Thanks Tomas ===== ful_tom@yahoo.com __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ From nielssteenkrogh@hotmail.com Thu Mar 6 21:19:10 2003 From: nielssteenkrogh@hotmail.com (Niels Steen Krogh) Date: Thu, 06 Mar 2003 22:19:10 +0100 Subject: [python-win32] Excel2000 and password Message-ID: I tried this code - maybee you must use the keyword "WriteResPassword" as well. /Niels from win32com.client import Dispatch o=Dispatch("Excel.Application") #start excel o.Workbooks.Open(Filename='c:\\dokumenter\\mappe13.xls',Password="peter",WriteResPassword="peter") Cand. Polit. Niels Steen Krogh Solsortvej 44 2000 F. Tlf: 3888 8613 > >Today's Topics: > > 1. Excel2000 and password (Tom) > >--__--__-- > >Date: Thu, 6 Mar 2003 06:08:01 -0800 (PST) >From: Tom >To: python-win32@python.org >Subject: [python-win32] Excel2000 and password > >Hello, > I have a problem with opening a password protected >xls document. When program runs, a Excel dialog prompt >for password is always displayed. > Here is a code: >self.xlApp = >win32com.client.Dispatch('Excel.Application') >self.xlBook = self.xlApp.Workbooks.Open(filename, >Password="Mypasswd") > >What's wrong? A parameter name Password is correct. > >Thanks Tomas > > >===== >ful_tom@yahoo.com > >__________________________________________________ >Do you Yahoo!? >Yahoo! Tax Center - forms, calculators, tips, more >http://taxes.yahoo.com/ _________________________________________________________________ Få Hotmail på mobilen http://www.msn.dk/mobile From BAlmond@russreid.com Thu Mar 6 21:29:04 2003 From: BAlmond@russreid.com (Brian Almond) Date: Thu, 06 Mar 2003 13:29:04 -0800 Subject: [python-win32] Excel2000 and password Message-ID: Maybe this is version dependant? I setup a protected Excel document (open protected) and while the Workbooks.Open method accepts my password argument OK, Excel still pops up a password prompt. >>> "Niels Steen Krogh" 03/06/03 01:19PM >>> I tried this code - maybee you must use the keyword "WriteResPassword" as well. /Niels From cdodt@fcoe.k12.ca.us Thu Mar 6 21:34:47 2003 From: cdodt@fcoe.k12.ca.us (Cory Dodt) Date: Thu, 06 Mar 2003 13:34:47 -0800 Subject: [python-win32] win32all 152 + COM server + py2exe == trouble Message-ID: <3E67BEF7.50101@fcoe.k12.ca.us> Maybe I'm the first one to report this; searching the ML hasn't turned up anything yet. (Wouldn't surprise me.) I have a py2exe'd COM server that uses your first recipe on the website. It has been stable for some time now. Recently I upgraded from win32all 148 to win32all 152 and found that the COM server wouldn't start in py2exe mode, even though it still works in pure python mode. After some registry spelunking I discovered that the key: My Computer\HKEY_CLASSES_ROOT\CLSID\{my classid} _exists_, has the (default) attribute set, but is empty. None of the subkeys are there, so naturally the COM server can't start because the subkeys are how COM knows what to run. Reverting to win32all 150 fixed the problem. Here's the matrix: win32all 150 win32all 152 _______________________________________ pure python | works | works | | py2exe | works | uuggggggh. (He must have died while | | carving it.) (works==subkeys exist after registering, and server starts and runs fine) (platform: win2000 SP3, Python 2.2.2 from python.org, distutils 1.0.3CVS, py2exe 0.3.3) On a side note: is there any way to inject into or attach a debugger to a py2exe program? If I could figure out how to do that, I could probably find out what's wrong by myself. From rick@kaye.to Thu Mar 6 23:14:23 2003 From: rick@kaye.to (Rick Kaye) Date: Thu, 06 Mar 2003 18:14:23 -0500 Subject: [python-win32] Problem Controlling Internet Explorer Message-ID: <000b01c2e436$23e321d0$6501a8c0@Dell2400> I am trying to control Internet Explorer from a Python script and running into a problem. My script looks like this: from win32com.client import Dispatch IE=Dispatch("InternetExplorer.Application") while IE.Busy: pass IE.Visible=1 IE.Navigate("c:\\test.html") while IE.Busy: pass page=IE.Document links=page.links links[0].click() If test.html looks like this: This link should pop up an alert box and it does from python as well as when clicked with the mouse Click ME the script works fine. It starts Internet Explorer and pops up the alert box. But if test.html looks like this: This link should open a new window with the test2 document. It works when clicked with the mouse but not when controlled from Python. Click ME Internet Explorer opens and plays the sound effect as if the link was clicked but no window opens. If I use Python to open this html page and then click the link with the mouse, it works fine. While this example illustrates the problem, in my real application, the html page that contains the link I'm trying to click is not under my control. So I can't change that page. Can anyone give me some help? From mhammond@skippinet.com.au Fri Mar 7 05:10:48 2003 From: mhammond@skippinet.com.au (Mark Hammond) Date: Fri, 7 Mar 2003 16:10:48 +1100 Subject: [python-win32] win32all 152 + COM server + py2exe == trouble In-Reply-To: <3E67BEF7.50101@fcoe.k12.ca.us> Message-ID: My bet is that the problem is to do with registration. I recently changed stuff to work better with McMillan's Installer. Specifically, there are some additional tricks played by registration if pythoncom.frozen is true. I bet you will find an exception when registering your server. You may find using win32traceutil will allow you to see the exception. I hope to play with py2exe soon - I only went with McMillan's 'cos someone sent me a starting-point :) Mark. > -----Original Message----- > From: python-win32-admin@python.org > [mailto:python-win32-admin@python.org]On Behalf Of Cory Dodt > Sent: Friday, 7 March 2003 8:35 AM > To: theller@python.net; python-win32@python.org > Subject: [python-win32] win32all 152 + COM server + py2exe == trouble > > > Maybe I'm the first one to report this; searching the ML hasn't turned > up anything yet. (Wouldn't surprise me.) > > I have a py2exe'd COM server that uses your first recipe on the website. > It has been stable for some time now. Recently I upgraded from > win32all 148 to win32all 152 and found that the COM server wouldn't > start in py2exe mode, even though it still works in pure python mode. > After some registry spelunking I discovered that the key: > My Computer\HKEY_CLASSES_ROOT\CLSID\{my classid} _exists_, has the > (default) attribute set, but is empty. None of the subkeys are there, > so naturally the COM server can't start because the subkeys are how COM > knows what to run. > > Reverting to win32all 150 fixed the problem. > > Here's the matrix: > win32all 150 win32all 152 > _______________________________________ > pure python | works | works > | | > py2exe | works | uuggggggh. (He must have died while > | | carving it.) > > (works==subkeys exist after registering, and server starts and runs fine) > (platform: win2000 SP3, Python 2.2.2 from python.org, distutils > 1.0.3CVS, py2exe 0.3.3) > > On a side note: is there any way to inject into or attach a debugger to > a py2exe program? If I could figure out how to do that, I could > probably find out what's wrong by myself. > > > > _______________________________________________ > Python-win32 mailing list > Python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 From mhammond@skippinet.com.au Fri Mar 7 05:13:51 2003 From: mhammond@skippinet.com.au (Mark Hammond) Date: Fri, 7 Mar 2003 16:13:51 +1100 Subject: [python-win32] Problem Controlling Internet Explorer In-Reply-To: <000b01c2e436$23e321d0$6501a8c0@Dell2400> Message-ID: > IE=Dispatch("InternetExplorer.Application") > while IE.Busy: > pass This is pretty evil - you will be chewing 100% of CPU. At least put a "sleep()" in. Better, you should use IE events - see win32com\test\testExplorer.py > window.open("/test2.html"); Does a fully-qualified URL work? It may be that the "current drive" is different in the 2 cases. Mark. From rick@kaye.to Fri Mar 7 06:07:28 2003 From: rick@kaye.to (Rick Kaye) Date: Fri, 07 Mar 2003 01:07:28 -0500 Subject: [python-win32] Problem Controlling Internet Explorer In-Reply-To: Message-ID: <000201c2e46f$d9cf9d00$6501a8c0@Dell2400> > > IE=Dispatch("InternetExplorer.Application") > > while IE.Busy: > > pass > > This is pretty evil - you will be chewing 100% of CPU. At least put a > "sleep()" in. > > Better, you should use IE events - see win32com\test\testExplorer.py Agreed. As soon as I get this working, I will clean up the code. > > window.open("/test2.html"); > > Does a fully-qualified URL work? It may be that the "current drive" is > different in the 2 cases. > > Mark. I don't think this is it. I tried a fully-qualified URL and it didn't work. I also switched the javascript function to window.navigate("/test2.html"); and it found test2.html with no problem. From theller@python.net Fri Mar 7 09:10:22 2003 From: theller@python.net (Thomas Heller) Date: 07 Mar 2003 10:10:22 +0100 Subject: [python-win32] Re: win32all 152 + COM server + py2exe == trouble References: <3E67BEF7.50101@fcoe.k12.ca.us> Message-ID: Cory Dodt writes: > On a side note: is there any way to inject into or attach a debugger > to a py2exe program? If I could figure out how to do that, I could > probably find out what's wrong by myself. Do you mean a C debugger or a Python debugger? For C, you need to build debug versions of all the extensions involved and py2exe itself. For Python, it should be possible to include pdb. Thomas From rick@kaye.to Fri Mar 7 16:15:48 2003 From: rick@kaye.to (Rick Kaye) Date: Fri, 07 Mar 2003 11:15:48 -0500 Subject: [python-win32] Problem Controlling Internet Explorer Message-ID: <000201c2e4c4$d4d5f5b0$6501a8c0@Dell2400> I figured it out. The program I use to stop pop-ups was preventing the open call from executing. The pop-up prevention program is smart enough to allow the open call when it's initiated by a mouse click but stops it when it's initiated programmatically. Mark, thanks for your help. > -----Original Message----- > From: Rick Kaye [mailto:rick@kaye.to] > Sent: Friday, March 07, 2003 1:07 AM > To: 'Mark Hammond'; 'python-win32@python.org' > Subject: RE: [python-win32] Problem Controlling Internet Explorer > > > > IE=Dispatch("InternetExplorer.Application") > > > while IE.Busy: > > > pass > > > > This is pretty evil - you will be chewing 100% of CPU. At least put a > > "sleep()" in. > > > > Better, you should use IE events - see win32com\test\testExplorer.py > > Agreed. As soon as I get this working, I will clean up the code. > > > > window.open("/test2.html"); > > > > Does a fully-qualified URL work? It may be that the "current drive" is > > different in the 2 cases. > > > > Mark. > > I don't think this is it. I tried a fully-qualified URL and it didn't > work. I also switched the javascript function to > window.navigate("/test2.html"); and it found test2.html with no problem. From corydodt@yahoo.com Fri Mar 7 16:42:45 2003 From: corydodt@yahoo.com (Cory Dodt) Date: Fri, 7 Mar 2003 08:42:45 -0800 (PST) Subject: [python-win32] win32all 152 + COM server + py2exe == trouble Message-ID: <20030307164245.82686.qmail@web10008.mail.yahoo.com> Point well taken about win32traceutil. I assumed it didn't work at all in py2exe because I had some trouble using it that way, but importing it explicitly worked, and gave me the following tb: $ python c:/python22/lib/site-packages/win32/lib/win32traceutil.py Collecting Python Trace Output... Unregistered: Lexicon.Python Traceback (most recent call last): File "", line 273, in ? File "", line 262, in run File "", line 253, in registerServer File "win32com\server\register.pyc", line 468, in UseCommandLine File "win32com\server\register.pyc", line 405, in RegisterClasses File "win32com\server\register.pyc", line 188, in RegisterServer AttributeError: 'module' object has no attribute 'frozen' The no-longer-working recipe I'm using is here: http://aspn.activestate.com/ASPN/Mail/Message/543305 It checks for sys.importers, and then sets pythoncom.frozen. BTW, I can't find any decent documentation on that attribute. > My bet is that the problem is to do with registration. I recently changed > stuff to work better with McMillan's Installer. > > Specifically, there are some additional tricks played by registration if > pythoncom.frozen is true. I bet you will find an exception when registering > your server. You may find using win32traceutil will allow you to see the > exception. I hope to play with py2exe soon - I only went with McMillan's 'cos > someone sent me a starting-point :) > > Mark. __________________________________________________ Do you Yahoo!? Yahoo! Tax Center - forms, calculators, tips, more http://taxes.yahoo.com/ From Jim.Vickroy@noaa.gov Fri Mar 7 19:08:57 2003 From: Jim.Vickroy@noaa.gov (Jim Vickroy) Date: Fri, 07 Mar 2003 12:08:57 -0700 Subject: [python-win32] Problem Controlling Internet Explorer References: <000201c2e4c4$d4d5f5b0$6501a8c0@Dell2400> Message-ID: <3E68EE49.285D2C19@noaa.gov> As a "lurker" on this thread, I am confused. Why does the pop-up detector stop window.open(...) but not window.navigate(...)? Rick Kaye wrote: > I figured it out. The program I use to stop pop-ups was preventing the open > call from executing. The pop-up prevention program is smart enough to allow > the open call when it's initiated by a mouse click but stops it when it's > initiated programmatically. > > Mark, thanks for your help. > > > -----Original Message----- > > From: Rick Kaye [mailto:rick@kaye.to] > > Sent: Friday, March 07, 2003 1:07 AM > > To: 'Mark Hammond'; 'python-win32@python.org' > > Subject: RE: [python-win32] Problem Controlling Internet Explorer > > > > > > IE=Dispatch("InternetExplorer.Application") > > > > while IE.Busy: > > > > pass > > > > > > This is pretty evil - you will be chewing 100% of CPU. At least put a > > > "sleep()" in. > > > > > > Better, you should use IE events - see win32com\test\testExplorer.py > > > > Agreed. As soon as I get this working, I will clean up the code. > > > > > > window.open("/test2.html"); > > > > > > Does a fully-qualified URL work? It may be that the "current drive" is > > > different in the 2 cases. > > > > > > Mark. > > > > I don't think this is it. I tried a fully-qualified URL and it didn't > > work. I also switched the javascript function to > > window.navigate("/test2.html"); and it found test2.html with no problem. > > _______________________________________________ > Python-win32 mailing list > Python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 From rick@kaye.to Fri Mar 7 19:46:56 2003 From: rick@kaye.to (Rick Kaye) Date: Fri, 07 Mar 2003 14:46:56 -0500 Subject: [python-win32] Problem Controlling Internet Explorer In-Reply-To: <3E68EE49.285D2C19@noaa.gov> Message-ID: <000f01c2e4e2$53d9a6f0$6501a8c0@Dell2400> Window.navigate(x) opens URL x in the existing window. Window.open(x) opens URL x in a new window which "pops up". > -----Original Message----- > From: Jim Vickroy [mailto:Jim.Vickroy@noaa.gov] > Sent: Friday, March 07, 2003 2:09 PM > To: Rick Kaye > Cc: 'Mark Hammond'; python-win32@python.org > Subject: Re: [python-win32] Problem Controlling Internet Explorer > > As a "lurker" on this thread, I am confused. > > Why does the pop-up detector stop window.open(...) but not > window.navigate(...)? > > Rick Kaye wrote: > > > I figured it out. The program I use to stop pop-ups was preventing the > open > > call from executing. The pop-up prevention program is smart enough to > allow > > the open call when it's initiated by a mouse click but stops it when > it's > > initiated programmatically. > > > > Mark, thanks for your help. > > > > > -----Original Message----- > > > From: Rick Kaye [mailto:rick@kaye.to] > > > Sent: Friday, March 07, 2003 1:07 AM > > > To: 'Mark Hammond'; 'python-win32@python.org' > > > Subject: RE: [python-win32] Problem Controlling Internet Explorer > > > > > > > > IE=Dispatch("InternetExplorer.Application") > > > > > while IE.Busy: > > > > > pass > > > > > > > > This is pretty evil - you will be chewing 100% of CPU. At least put > a > > > > "sleep()" in. > > > > > > > > Better, you should use IE events - see win32com\test\testExplorer.py > > > > > > Agreed. As soon as I get this working, I will clean up the code. > > > > > > > > window.open("/test2.html"); > > > > > > > > Does a fully-qualified URL work? It may be that the "current drive" > is > > > > different in the 2 cases. > > > > > > > > Mark. > > > > > > I don't think this is it. I tried a fully-qualified URL and it didn't > > > work. I also switched the javascript function to > > > window.navigate("/test2.html"); and it found test2.html with no > problem. > > > > _______________________________________________ > > Python-win32 mailing list > > Python-win32@python.org > > http://mail.python.org/mailman/listinfo/python-win32 From johnson@equadriga.com Sat Mar 8 04:37:40 2003 From: johnson@equadriga.com (Elester Johnson) Date: Sat, 8 Mar 2003 10:07:40 +0530 Subject: [python-win32] Python COM - Project 2000 (openPool attribute) Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_007E_01C2E55A.8D8CD6B0 Content-Type: multipart/alternative; boundary="----=_NextPart_001_007F_01C2E55A.8D8E8460" ------=_NextPart_001_007F_01C2E55A.8D8E8460 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi , I need to open a Project 2000 file without the Shared Resource Dialog poping-up using python. I tried to manipulate the openPool property in the FileOpen method by setting it to "pjDoNotOpenPool" - ie. 0x4 . But this doesnt work for me. Still I get the dialog poping-up. Kindly help me out. TIA. Kind Rgds, Elester Johnson ------=_NextPart_001_007F_01C2E55A.8D8E8460 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
 
Hi = ,
 
    I need to open a Project 2000 file without the = Shared=20 Resource Dialog poping-up using python. I tried to manipulate the = openPool=20 property in the FileOpen method by setting it to "pjDoNotOpenPool" - ie. 0x4 . But this = doesnt=20 work for me. Still I get the dialog poping-up. Kindly help me=20 out.
 
TIA.
Kind Rgds,
    Elester=20 Johnson
------=_NextPart_001_007F_01C2E55A.8D8E8460-- ------=_NextPart_000_007E_01C2E55A.8D8CD6B0 Content-Type: image/jpeg; name="Notebook.jpg" Content-Transfer-Encoding: base64 Content-ID: <794493504@08032003-128c> /9j/4AAQSkZJRgABAgEASABIAAD/7QSyUGhvdG9zaG9wIDMuMAA4QklNA+kAAAAAAHgAAwAAAEgA SAAAAAADBgJS//f/9wMPAlsDRwUoA/wAAgAAAEgASAAAAAAC2AIoAAEAAABkAAAAAQADAwMAAAAB Jw8AAQABAAAAAAAAAAAAAAAAYAgAGQGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4 QklNA+0AAAAAABAASAAAAAEAAQBIAAAAAQABOEJJTQPzAAAAAAAIAAAAAAAAAAA4QklNBAoAAAAA AAEAADhCSU0nEAAAAAAACgABAAAAAAAAAAI4QklNA/UAAAAAAEgAL2ZmAAEAbGZmAAYAAAAAAAEA L2ZmAAEAoZmaAAYAAAAAAAEAMgAAAAEAWgAAAAYAAAAAAAEANQAAAAEALQAAAAYAAAAAAAE4QklN A/gAAAAAAHAAAP////////////////////////////8D6AAAAAD///////////////////////// ////A+gAAAAA/////////////////////////////wPoAAAAAP////////////////////////// //8D6AAAOEJJTQQAAAAAAAACAAA4QklNBAIAAAAAAAIAADhCSU0ECAAAAAAAEAAAAAEAAAJAAAAC QAAAAAA4QklNBAkAAAAAAqIAAAABAAAAgAAAAAIAAAGAAAADAAAAAoYAGAAB/9j/4AAQSkZJRgAB AgEASABIAAD//gAnRmlsZSB3cml0dGVuIGJ5IEFkb2JlIFBob3Rvc2hvcKggNC4wAP/uAA5BZG9i ZQBkgAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwPFRgTExUTExgRDAwMDAwMEQwMDAwMDAwM DAwMDAwMDAwMDAwMDAwMDAwMDAwBDQsLDQ4NEA4OEBQODg4UFA4ODg4UEQwMDAwMEREMDAwMDAwR DAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDP/AABEIAAIAgAMBIgACEQEDEQH/3QAEAAj/xAE/ AAABBQEBAQEBAQAAAAAAAAADAAECBAUGBwgJCgsBAAEFAQEBAQEBAAAAAAAAAAEAAgMEBQYHCAkK CxAAAQQBAwIEAgUHBggFAwwzAQACEQMEIRIxBUFRYRMicYEyBhSRobFCIyQVUsFiMzRygtFDByWS U/Dh8WNzNRaisoMmRJNUZEXCo3Q2F9JV4mXys4TD03Xj80YnlKSFtJXE1OT0pbXF1eX1VmZ2hpam tsbW5vY3R1dnd4eXp7fH1+f3EQACAgECBAQDBAUGBwcGBTUBAAIRAyExEgRBUWFxIhMFMoGRF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qkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl 8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXy qkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKq SSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJ KfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp +qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6 qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn/2Q== ------=_NextPart_000_007E_01C2E55A.8D8CD6B0-- From dhruv_dhody@hotmail.com Sat Mar 8 06:35:08 2003 From: dhruv_dhody@hotmail.com (Dhruv Dhody) Date: Sat, 8 Mar 2003 12:05:08 +0530 Subject: [python-win32] Multiple Instances of wxPython com object hangs VB Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_0018_01C2E56A.F6C847D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, =20 I am working on python and VB. I have a com server on python which is a = drawing application. I create an object in VB to start the application = when I click on the menu in the form. If at a time only one instance of = the application is crated then it works properly. If I open multiple = instances of the application without closing the previous windows then = also everything works fine until I close the MDI Form. When i close the = MDI Form, the MDI Form closes but VB hangs. =20 VB Code : Private Sub mnuHi_Click() Dim a As Object Set a =3D CreateObject("Python.Dhruv") a.make Set a =3D Nothing End Sub Python Code : class Dhruv: _reg_clsid_ =3D "{37F1DE73-2DE8-49A9-B5FB-794439E2C618}" _reg_desc_ =3D "Dhruv" _reg_progid_ =3D "Python.Dhruv" _reg_clsctx_ =3D CLSCTX_INPROC _public_methods_ =3D ['make'] _public_attrs_ =3D [] _readonly_attrs_ =3D [] _reg_class_spec_ =3D "d.Dhruv" def make(self): self.app =3D wxPySimpleApp() self.frame1 =3D DoodleFrame1(None) self.frame1.Show(true) self.app.MainLoop() def RegisterMe(): import win32com.server.register win32com.server.register.UseCommandLine(Dhruv) RegisterMe() =20 How can I prevent this?? =20 Dhruv =20 ------=_NextPart_000_0018_01C2E56A.F6C847D0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

Hi,

 

I am = working on=20 python and VB. I have a com server on python which is a drawing = application. I=20 create an object in VB to start the application when I click on the menu = in the=20 form. If at a time only one instance of the application is crated then = it works=20 properly.   If I open = multiple=20 instances of the application without closing the previous windows then = also=20 everything works fine until I close the MDI Form. When i close the MDI = Form, the=20 MDI Form closes but VB hangs.

 

VB = Code=20 :

 

Private Sub=20 mnuHi_Click()

    Dim a As=20 Object

    Set a =3D=20 CreateObject("Python.Dhruv")

    = a.make

    Set a =3D=20 Nothing

End=20 Sub

 

Python Code=20 :

 

class=20 Dhruv:
    _reg_clsid_ =3D=20 "{37F1DE73-2DE8-49A9-B5FB-794439E2C618}"
    = _reg_desc_ =20 =3D "Dhruv"
    _reg_progid_ =3D=20 "Python.Dhruv"
    _reg_clsctx_ =3D=20 CLSCTX_INPROC
    _public_methods_ =3D=20 ['make']
    _public_attrs_ =3D = []
   =20 _readonly_attrs_ =3D []
    _reg_class_spec_ =3D=20 "d.Dhruv"
    def=20 make(self):
        self.app =3D=20 wxPySimpleApp()
        = self.frame1 =3D=20 DoodleFrame1(None)
       =20 self.frame1.Show(true)
       =20 self.app.MainLoop()

def RegisterMe():
    import=20 win32com.server.register
   =20 win32com.server.register.UseCommandLine(Dhruv)

 

RegisterMe()    

 

How = can I prevent=20 this??

 

Dhruv

 

------=_NextPart_000_0018_01C2E56A.F6C847D0-- From johnson@equadriga.com Sat Mar 8 07:04:50 2003 From: johnson@equadriga.com (Elester Johnson) Date: Sat, 8 Mar 2003 12:34:50 +0530 Subject: [python-win32] Python COM - Project 2000 (openPool attribute) Message-ID: This is a multi-part message in MIME format. ------=_NextPart_000_0007_01C2E56F.1D06CA30 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0008_01C2E56F.1D0CE4B0" ------=_NextPart_001_0008_01C2E56F.1D0CE4B0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hi , I need to open a Project 2000 file without the Shared Resource Dialog poping-up using python. I tried to manipulate the openPool property in the FileOpen method by setting it to "pjDoNotOpenPool" - ie. 0x4 . But this doesnt work for me. Still I get the dialog poping-up. code sample: prj = DispatchEx( 'MSProject.Application' ) # create instance of Project prj.Visible = False prjapp = prj.Application.FileOpen(Name="somename.mpp",IgnoreReadOnlyRecommended=1,ope nPool=0x4, NoAuto=True) ****** openPool = 0x4 , is = pjDoNotOpenPool..........But still I get the dialog being popped-up. Kindly help me out. TIA. Kind Rgds, Elester Johnson ------=_NextPart_001_0008_01C2E56F.1D0CE4B0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi = ,
 
    I need to open a Project 2000 file without the = Shared=20 Resource Dialog poping-up using python. I tried to manipulate the = openPool=20 property in the FileOpen method by setting it to "pjDoNotOpenPool" - ie. 0x4 . But this = doesnt=20 work for me. Still I get the dialog poping-up.
 
code=20 sample:
 
prj =3D DispatchEx( 'MSProject.Application' )    = # create=20 instance of Project
prj.Visible =3D False
prjapp =3D prj.Application.FileOpen(Name=3D"somename.mpp",IgnoreReadOnlyRecommended= =3D1,openPool=3D0x4,=20 NoAuto=3DTrue)
 
****** openPool =3D = 0x4   ,=20 is =3D pjDoNotOpenPool..........But still I get the dialog being=20 popped-up.
Kindly help me=20 out.
 
TIA.
Kind Rgds,
    Elester=20 Johnson
------=_NextPart_001_0008_01C2E56F.1D0CE4B0-- ------=_NextPart_000_0007_01C2E56F.1D06CA30 Content-Type: image/jpeg; name="Notebook.jpg" Content-Transfer-Encoding: base64 Content-ID: <582465406@08032003-30ff> /9j/4AAQSkZJRgABAgEASABIAAD/7QSyUGhvdG9zaG9wIDMuMAA4QklNA+kAAAAAAHgAAwAAAEgA SAAAAAADBgJS//f/9wMPAlsDRwUoA/wAAgAAAEgASAAAAAAC2AIoAAEAAABkAAAAAQADAwMAAAAB Jw8AAQABAAAAAAAAAAAAAAAAYAgAGQGQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4 QklNA+0AAAAAABAASAAAAAEAAQBIAAAAAQABOEJJTQPzAAAAAAAIAAAAAAAAAAA4QklNBAoAAAAA AAEAADhCSU0nEAAAAAAACgABAAAAAAAAAAI4QklNA/UAAAAAAEgAL2ZmAAEAbGZmAAYAAAAAAAEA L2ZmAAEAoZmaAAYAAAAAAAEAMgAAAAEAWgAAAAYAAAAAAAEANQAAAAEALQAAAAYAAAAAAAE4QklN A/gAAAAAAHAAAP////////////////////////////8D6AAAAAD///////////////////////// ////A+gAAAAA/////////////////////////////wPoAAAAAP////////////////////////// //8D6AAAOEJJTQQAAAAAAAACAAA4QklNBAIAAAAAAAIAADhCSU0ECAAAAAAAEAAAAAEAAAJAAAAC QAAAAAA4QklNBAkAAAAAAqIAAAABAAAAgAAAAAIAAAGAAAADAAAAAoYAGAAB/9j/4AAQSkZJRgAB AgEASABIAAD//gAnRmlsZSB3cml0dGVuIGJ5IEFkb2JlIFBob3Rvc2hvcKggNC4wAP/uAA5BZG9i ZQBkgAAAAAH/2wCEAAwICAgJCAwJCQwRCwoLERUPDAwPFRgTExUTExgRDAwMDAwMEQwMDAwMDAwM DAwMDAwMDAwMDAwMDAwMDAwMDAwBDQsLDQ4NEA4OEBQODg4UFA4ODg4UEQwMDAwMEREMDAwMDAwR DAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDP/AABEIAAIAgAMBIgACEQEDEQH/3QAEAAj/xAE/ AAABBQEBAQEBAQAAAAAAAAADAAECBAUGBwgJCgsBAAEFAQEBAQ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KfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp +qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6 qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqp JfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl 8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXy qkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKq SSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJ KfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp +qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn6 qSXyqkkp+qkl8qpJKfqpJfKqSSn6qSXyqkkp+qkl8qpJKfqpJfKqSSn/2Q== ------=_NextPart_000_0007_01C2E56F.1D06CA30-- From steve_g@ix.netcom.com Sat Mar 8 18:18:07 2003 From: steve_g@ix.netcom.com (Steve Goldman) Date: Sat, 8 Mar 2003 13:18:07 -0500 Subject: [python-win32] COM Event Question Message-ID: <001101c2e59f$123acf40$0200000a@fred> This is a multi-part message in MIME format. ------=_NextPart_000_000E_01C2E575.2882F2C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I'm having trouble seeing events from a python COM client application. = The COM=20 server is an "OPC Automation 2.0" object, which is used to communicate = with industrial control products. After running the makepy script, I can see that the OPC Automation = object has several different object classes (e.g., OPCServer, OPCGroups,OPCGroup), each = with their own events. DispatchWithEvents allows me to get an OPCServer object and = see=20 OPCServer events. However, I can't see events associated with an = OPCGroup. The OPCGroup object is created using the "Add" method of OPCGroups. = OPCGroup is not a registered class.=20 Using VB, I can see both OPCServer and OPCGroup events. The following = two programs should both print each time a "Data Change" or "Server Shutdown" event = occurs. The VB program does; the python program only sees the "Server Shutdown" = event. The programs are virtually identical, except that VB makes you declare your = object variables up front, so I can use "WithEvents" on the OPCGroup. How do I dispatch the OPCGroup class to see events in Python? I'd = appreciate any advice. Thanks in advance for your help. Steve Goldman ****************************** Minimal VB Program ****************************** Dim WithEvents OPC As OPCServer Dim Groups As OPCGroups Dim WithEvents Group As OPCGroup Dim Items As OPCItems Dim Item As OPCItem Private Sub Form_Load() Set OPC =3D New OPCServer OPC.Connect ("KEPWare.KEPServerEX.V4") Set Groups =3D OPC.OPCGroups Set Group =3D Groups.Add("Group 1") Group.IsSubscribed =3D True Set Items =3D Group.OPCItems Set Item =3D Items.AddItem("Channel_0_User_Defined.Sine.Sine1", 1) End Sub Private Sub Group_DataChange(ByVal TransactionID As Long, ByVal NumItems = As Long, ClientHandles() As Long, ItemValues() As Variant, Qualities() = As Long, TimeStamps() As Date) Debug.Print "Data Change at", Now() End Sub Private Sub OPC_ServerShutDown(ByVal Reason As String) Debug.Print "Server Shutdown at", Now() End Sub #This program sees a Data Change event about once per second #until the server is shut down. ************************************** Minimal Python Program ************************************** import win32com.client, pythoncom,time class OPCEvents: def = OnDataChange(self,TransactionID,NumItems,ClientHandles,ItemValues,Qualiti= es,TimeStamps): print 'Data Change at', time.ctime() =20 def OnServerShutDown(self, Reason): print 'Server Shutdown at',time.ctime() OPC=3Dwin32com.client.DispatchWithEvents('OPC.Automation.1',OPCEvents) OPC.Connect('KEPware.KEPServerEx.V4') groups=3DOPC.OPCGroups group=3Dgroups.Add('Group 1') group.IsSubscribed=3D1 items=3Dgroup.OPCItems item=3Ditems.AddItem('Channel_0_User_Defined.Sine.Sine1',1) x=3D0 while x<2000000: pythoncom.PumpWaitingMessages() x=3Dx+1 #This program only shows the server shutting down. #It can't see Data Change events. ------=_NextPart_000_000E_01C2E575.2882F2C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
 
I'm having trouble seeing events from a = python COM=20 client application.  The COM
server is an "OPC Automation 2.0" = object,=20 which is used to communicate with industrial
control = products.
 
After running the makepy script, I can = see that the=20 OPC Automation object has several
different object classes = (e.g.,=20 OPCServer, OPCGroups,OPCGroup), each with their
own events. =20 DispatchWithEvents allows me to get an OPCServer object and see =
OPCServer=20 events. However, I can't see events associated with an OPCGroup.
The = OPCGroup=20 object is created using the "Add" method of OPCGroups.  = OPCGroup
is not=20 a registered class.
 
Using VB, I can see both OPCServer and = OPCGroup=20 events.  The following two programs
should both print each time = a "Data=20 Change" or "Server Shutdown" event occurs.  The
VB program does; = the=20 python program only sees the "Server Shutdown" event.  = The
programs are=20 virtually identical, except that VB makes you declare your = object
variables=20 up front, so I can use "WithEvents" on the OPCGroup.
 
How do I dispatch the OPCGroup = class to=20 see events in Python?  I'd appreciate = any
advice.
 
Thanks in advance for your = help.
 
Steve Goldman
 
******************************
Minimal VB=20 Program
******************************
 
Dim WithEvents OPC As OPCServer
Dim = Groups As=20 OPCGroups
Dim WithEvents Group As OPCGroup
Dim Items As = OPCItems
Dim=20 Item As OPCItem
 
Private Sub Form_Load()
Set OPC =3D = New=20 OPCServer
OPC.Connect ("KEPWare.KEPServerEX.V4")
Set Groups =3D=20 OPC.OPCGroups
Set Group =3D Groups.Add("Group = 1")
Group.IsSubscribed =3D=20 True
Set Items =3D Group.OPCItems
Set Item =3D=20 Items.AddItem("Channel_0_User_Defined.Sine.Sine1", 1)
End = Sub
 
Private Sub Group_DataChange(ByVal = TransactionID As=20 Long, ByVal NumItems As Long, ClientHandles() As Long, ItemValues() As = Variant,=20 Qualities() As Long, TimeStamps() As Date)
Debug.Print "Data Change = at",=20 Now()
End Sub
 
Private Sub OPC_ServerShutDown(ByVal = Reason As=20 String)
Debug.Print "Server Shutdown at", Now()
End = Sub
 
#This program sees a Data Change event = about once=20 per second
#until the server is shut down.
 
**************************************
Minimal=20 Python Program
**************************************
import=20 win32com.client, pythoncom,time
 
class OPCEvents:
    = def=20 OnDataChange(self,TransactionID,NumItems,ClientHandles,ItemValues,Qualiti= es,TimeStamps):
       =20 print 'Data Change at', time.ctime()
   =20
    def OnServerShutDown(self,=20 Reason):
        print 'Server = Shutdown=20 at',time.ctime()
 
OPC=3Dwin32com.client.DispatchWithEvents('OPC.Automation.1',OPCE= vents)
OPC.Connect('KEPware.KEPServerEx.V4')
groups=3DOPC.OPCGroups=
group=3Dgroups.Add('Group=20 1')
group.IsSubscribed=3D1
items=3Dgroup.OPCItems
item=3Ditems.A= ddItem('Channel_0_User_Defined.Sine.Sine1',1)
x=3D0
while=20 x<2000000:
   =20 pythoncom.PumpWaitingMessages()
    = x=3Dx+1
 
#This program only shows the server = shutting=20 down.
#It can't see Data Change events.
------=_NextPart_000_000E_01C2E575.2882F2C0-- From mhammond@skippinet.com.au Sun Mar 9 23:33:22 2003 From: mhammond@skippinet.com.au (Mark Hammond) Date: Mon, 10 Mar 2003 10:33:22 +1100 Subject: [python-win32] Python COM - Project 2000 (openPool attribute) In-Reply-To: Message-ID: Make sure you have the most recent win32all available - named arguments were recently fixed, and this is almost certainly your problem. Mark. -----Original Message----- From: python-win32-admin@python.org [mailto:python-win32-admin@python.org]On Behalf Of Elester Johnson Sent: Saturday, 8 March 2003 6:05 PM To: python-win32@python.org Subject: [python-win32] Python COM - Project 2000 (openPool attribute) Hi , I need to open a Project 2000 file without the Shared Resource Dialog poping-up using python. I tried to manipulate the openPool property in the FileOpen method by setting it to "pjDoNotOpenPool" - ie. 0x4 . But this doesnt work for me. Still I get the dialog poping-up. code sample: prj = DispatchEx( 'MSProject.Application' ) # create instance of Project prj.Visible = False prjapp = prj.Application.FileOpen(Name="somename.mpp",IgnoreReadOnlyRecommended=1,ope nPool=0x4, NoAuto=True) ****** openPool = 0x4 , is = pjDoNotOpenPool..........But still I get the dialog being popped-up. Kindly help me out. TIA. Kind Rgds, Elester Johnson From mhammond@skippinet.com.au Sun Mar 9 23:45:49 2003 From: mhammond@skippinet.com.au (Mark Hammond) Date: Mon, 10 Mar 2003 10:45:49 +1100 Subject: [python-win32] COM Event Question In-Reply-To: <001101c2e59f$123acf40$0200000a@fred> Message-ID: > Using VB, I can see both OPCServer and OPCGroup events. The following > two programs should both print each time a "Data Change" or > "Server Shutdown" event occurs. It is not clear to me that you have 2 event classes here - is it one event class for both objects? ie, I would have expected to see *two* event classes in your Python code. > groups=OPC.OPCGroups > group=groups.Add('Group 1') You can use DispatchWithEvents() on "group" here. Eg, adding: group = DispatchWithEvents(group, ClassName) would convert it into an event source. However, as I mentioned, I would generally expect to see 2 event classes - one for OPC, and one for group. Mark. From mhammond@skippinet.com.au Sun Mar 9 23:52:03 2003 From: mhammond@skippinet.com.au (Mark Hammond) Date: Mon, 10 Mar 2003 10:52:03 +1100 Subject: [python-win32] win32all 152 + COM server + py2exe == trouble In-Reply-To: <20030307164245.82686.qmail@web10008.mail.yahoo.com> Message-ID: > Point well taken about win32traceutil. I assumed it didn't work at all in > py2exe because I had some trouble using it that way, but importing it > explicitly worked, and gave me the following tb: ... > File "win32com\server\register.pyc", line 188, in RegisterServer > AttributeError: 'module' object has no attribute 'frozen' Having a look at this shows: if pythoncom.frozen: assert sys.frozen, "pythoncom is frozen, but sys.frozen is not set - don't know the context!" if sys.frozen == "dll": In McMillan's installer, if pythoncom.frozen is set, sys.frozen will be either 1 (for backwards compat, meaning .exe) or "dll", meaning a DLL. register.py is trying to work out how to register itself, as these 2 cases are different. (Previously, McMillan, and I presume py2exe, had nasty hacks to perform correct registration of COM objects. It made much more sense to me for win32com to directly support these advanced registation requirements. Thus, there may be py2exe hacks that could be removed) If someone can suggest a change here, that would be great. For now, simply remove the assert, and change the following line to: if hasattr(sys, "frozen") and sys.frozen == "dll": This will force register.py to take the 'else' path here, assuming a .exe. Let me know if that is all that is broken. Mark. From nhytro-python@web.de Mon Mar 10 08:11:51 2003 From: nhytro-python@web.de (nhytro-python@web.de) Date: Mon, 10 Mar 2003 09:11:51 +0100 Subject: [python-win32] ASP on Win XP Pro Message-ID: <200303100811.h2A8Bp801385@mailgate5.cinetic.de> Hi, Could someone tell me how to configure IIs for Python ASP on Windows XP = Pro=3F I have "googled" and read a few solutions, no of which helped. Instal= ling the latest ActiveState Python did=B4nt register AXScript, doubleclickin= g on pyscript.py did'nt work either. I then decide to download Python 2.23= b for Python .org and Win32all-153.exe , everything went well except for t= he registration of the com server, it exited with this error dialogue: Registartion of the AXScript Engine Com server failed. execptions.AttributeError:'module' object has no attribute 'compile' Can someone help me out=3F thanks =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F Wir benachrichtigen Sie =FCber neue E-Mails, wo immer Sie moechten. WEB.DE FreeMail - http://freemail.web.de/features/=3Fmc=3D021186 From johnson@equadriga.com Mon Mar 10 10:12:08 2003 From: johnson@equadriga.com (Elester Johnson) Date: Mon, 10 Mar 2003 15:42:08 +0530 Subject: [python-win32] Win32 and excel charts Message-ID: Hi Antone, Try this..its just a sample - may be of some help.....I can send a detailed one later.. wkb.Charts.Add() wkb.ActiveChart.ChartType = 0x33 #BAR #wkb.ActiveChart.ChartType = 0x3b #pie #wkb.ActiveChart.ChartType = 0x47 #bar/pie wkb.ActiveChart.SetSourceData( Source=wkb.Sheets("WORKSHEETNAME").Range("A3:A10") ) wkb.ActiveChart.Location( Where =0x2, Name ="WORKSHEETNAME") where, - WORKSHEETNAME = name of worksheet - A3:A10 is the data of the column or row for the axis u need. for x and y , use UNION, or Range(range,range) - Location - specify where to place the chart ie. as an object in the same sheet or a new worksheet Elester Johnson From mhammond@skippinet.com.au Mon Mar 10 11:39:26 2003 From: mhammond@skippinet.com.au (Mark Hammond) Date: Mon, 10 Mar 2003 22:39:26 +1100 Subject: [python-win32] COM Event Question In-Reply-To: <000601c2e6be$318d1720$0200000a@fred> Message-ID: > That threw an AttributeError, because my "group" didn't have a > .GetTypeInfo() method. I also tried dispatching the OPCGroup object using > the CLSID from the type library, but I got a COM error (object not > registered). So I'm still stuck on how to dispatch my OPCGroup > with events. That is a shame. It means life will be more difficult. Technically, makepy should have the info it needs without this - I will try and remember to look into this. > A separate problem, but one that may be related, is that I can't > get all the > methods in the type library to work. Many of them do, but not all. It > seems that methods that pass "dynamically sized arrays" aren't working for > me. I get a COM error, with an SCode value of E_INVALIDARG. > Since most of > the events also pass these arrays, I wonder if that creates a problem. It may. We work with most COM objects perfectly, but alot of the rules are pretty vague, so we do occasionally strike problems. Particularly with "older" projects, where the IDispatch implementations are manual, rather than automatic (as with VB/ATL) > I'd appreciate any additional pointers you might have on how to further > troubleshoot this. I'd also like to say that I really appreciate > the tools > and documentation that you've developed. I'm reading your book, and I'm > just having a lot of fun using python with Windows. Thanks. You will probably have to get down at the raw COM level, or help fix DispatchWithEvents ;) Mark. From steve_g@ix.netcom.com Mon Mar 10 04:33:24 2003 From: steve_g@ix.netcom.com (Steve Goldman) Date: Sun, 9 Mar 2003 23:33:24 -0500 Subject: [python-win32] COM Event Question References: Message-ID: <000601c2e6be$318d1720$0200000a@fred> Mark, Thank you for your response. The classes in the COM object are as follows: OPCBrowser(DispatchBaseClass) IOPCGroups(DispatchBaseClass) IOPCGroup(DispatchBaseClass) DIOPCGroupEvent - an Event Class OPCItems(DispatchBaseClass) OPCItem(DispatchBaseClass) OPCServer(CoClassBaseClass)-the registered COM automation object (OPC.Automation.1) OPCGroup(CoClassBaseClass)- the automation object I'm trying to get events from DIOPCGroupsEvent - an Event Class OPCGroups(CoClassBaseClass)- a collection of the automation objects I'm trying to get events from IOPCAutoServer(DispatchBaseClass) DIOPCServerEvent - an Event Class There are 3 event classes in the type library and 3 "automation object" classes that are associated with them. Based on what you said, I should have 3 separate user-defined event handlers in my code. I have changed my code to do that, and I will see how it works as I get further. I tried to dispatch the OPCGroup object as you suggested. > > groups=OPC.OPCGroups > > group=groups.Add('Group 1') > group = DispatchWithEvents(group, ClassName) That threw an AttributeError, because my "group" didn't have a .GetTypeInfo() method. I also tried dispatching the OPCGroup object using the CLSID from the type library, but I got a COM error (object not registered). So I'm still stuck on how to dispatch my OPCGroup with events. A separate problem, but one that may be related, is that I can't get all the methods in the type library to work. Many of them do, but not all. It seems that methods that pass "dynamically sized arrays" aren't working for me. I get a COM error, with an SCode value of E_INVALIDARG. Since most of the events also pass these arrays, I wonder if that creates a problem. I'd appreciate any additional pointers you might have on how to further troubleshoot this. I'd also like to say that I really appreciate the tools and documentation that you've developed. I'm reading your book, and I'm just having a lot of fun using python with Windows. Thanks. From steve_g@ix.netcom.com Mon Mar 10 22:43:36 2003 From: steve_g@ix.netcom.com (Steve Goldman) Date: Mon, 10 Mar 2003 17:43:36 -0500 Subject: [python-win32] COM Event Question References: Message-ID: <000c01c2e756$7e08b9e0$0200000a@fred> > You will probably have to get down at the raw COM level, or help fix > DispatchWithEvents ;) > OK, I am on the case :) Unfortunately, I don't know C++ or C. I'm actually a Chem E, not a programmer. I will look at some COM documentation, poke around a bit, and try to do similar tasks with Excel. If I find out anything interesting, I will post it to the mailing list. Thanks for your help. Steve. From pschay@pobox.com Tue Mar 11 02:47:21 2003 From: pschay@pobox.com (Peter Schay) Date: Mon, 10 Mar 2003 18:47:21 -0800 (PST) Subject: [python-win32] standalone COM server question Message-ID: <20030311024721.79864.qmail@web21404.mail.yahoo.com> Hi, I'm trying to use the mcmillan installer to distribute a windows COM server. I can get a regular program to work but not the COM server. Something is not right; I'd be most grateful for suggestions. After running MakeCOMServer.py and Build.py, the resulting exe file can show signs of life by popping up a win32ui.MessageBox when I run it on my dev system (which has python installed). However; when I run it on a freshly installed Win2KPro system (with all the latest updates but nothing more), nothing happens! If I install Python, still nothing happens. Once I install win32all, the program works (i.e. it pops up a dialog box). What does win32all add to the system to make this work? Is it possible for me to distribute this COM server without requiring target systems to have Python and win32all? The following trivial, non-comserver program works just fine from the mcmillan installer distribution on the freshly-installed Win2KPro system: import win32ui win32ui.MessageBox("hello") Thanks, Pete From vishnu_mahendra@yahoo.com Tue Mar 11 07:02:09 2003 From: vishnu_mahendra@yahoo.com (vishnu mahendra) Date: Mon, 10 Mar 2003 23:02:09 -0800 (PST) Subject: [python-win32] *.py to *.exe Message-ID: <20030311070209.91862.qmail@web40802.mail.yahoo.com> please tell me how to conver python files to exe files __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com From pschay@pobox.com Tue Mar 11 14:30:05 2003 From: pschay@pobox.com (Peter Schay) Date: Tue, 11 Mar 2003 06:30:05 -0800 Subject: [python-win32] *.py to *.exe References: <20030311070209.91862.qmail@web40802.mail.yahoo.com> Message-ID: <3E6DF2ED.7AA130F3@pobox.com> There are a few ways to do it. It looks like the mcmillan installer works well, and py2exe is also pretty good. For information, take a look at this web page for mcmillan, which also talks about similar solutions: http://www.mcmillan-inc.com/install1.html Pete vishnu mahendra wrote: > please tell me how to conver python files to exe files > From pschay@pobox.com Tue Mar 11 18:50:25 2003 From: pschay@pobox.com (Peter Schay) Date: Tue, 11 Mar 2003 10:50:25 -0800 (PST) Subject: [python-win32] Re: standalone COM server question Message-ID: <20030311185025.97709.qmail@web21410.mail.yahoo.com> I copied PythonCOM22.dll into the mcmillan-generated distribution folder for my COM server and all's well now. Thanks, Pete --- Peter Schay wrote: > Hi, > I'm trying to use the mcmillan installer to > distribute a windows COM server. I can get a > regular > program to work but not the COM server. Something > is > not right; I'd be most grateful for suggestions. > > > After running MakeCOMServer.py and Build.py, the > resulting exe file can show signs of life by popping > up a win32ui.MessageBox when I run it on my dev > system > (which has python installed). However; when I run > it > on a freshly installed Win2KPro system (with all the > latest updates but nothing more), nothing happens! > > If I install Python, still nothing happens. Once > I > install win32all, the program works (i.e. it pops up > a > dialog box). What does win32all add to the system > to > make this work? Is it possible for me to distribute > this COM server without requiring target systems to > have Python and win32all? > > The following trivial, non-comserver program works > just fine from the mcmillan installer distribution > on > the freshly-installed Win2KPro system: > import win32ui > win32ui.MessageBox("hello") > > Thanks, > Pete > > > From jj@void.si Wed Mar 12 00:13:23 2003 From: jj@void.si (jj@void.si) Date: Wed, 12 Mar 2003 01:13:23 +0100 (CET) Subject: [python-win32] ANN: pyasp v0.2 Message-ID: <3546.212.118.71.152.1047428003.squirrel@gw.void.si> PyAsp is tool which tries to make python asp coding easier. It is compatible with MS IIS serverpages as much as possible. PyAsp is not a IIS replacement, but a small in-house tool which adds profiling and debugging to Mark's python ASP implementation. Features - Generated python source can be debugged using pywin.debugger - Profiler support - Request tracking: each served page can be tracked to last 12 requests and for each request we can see complete output (including headers), request header, session variables, time used to serve the request - Simple user interface (self hosted by PyAsp and accessible with latest browsers (must support xml and xslt, tested with ie6, phoenix) - XML-RPC in asp page, self documenting, browser invocation - Standalone web server to test python ASP scripts. - Embedded asp server - PyAsp in own thread can provide web interface to the app. - Happydoc collects comments of all served pages. - Power Service Objects are integrated in mod_python version http://freeweb.siol.net/voidconn/jj/pyasp Janez Jere From nhytro-python@web.de Wed Mar 12 08:34:13 2003 From: nhytro-python@web.de (nhytro-python@web.de) Date: Wed, 12 Mar 2003 09:34:13 +0100 Subject: [python-win32] Python ASP on Windows XP Pro and IIs5 Message-ID: <200303120834.h2C8YD818640@mailgate5.cinetic.de> Hi all! I=B4ve finally got the Python Scripting module registered with the Help of M= r. Hammond (thanks) but strangely I can only execute an ASP script only on= ce and never again till I restart the machine, is there a workaround or so= mething else that I have to configure=3F Thanks nhytro =5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F= =5F=5F=5F=5F Den Komfort von WEB.DE FreeMail nutzen, aber die alten E-Mail-Adressen nic= ht aufgeben=3F Kein Problem: http://freemail.web.de/features/=3Fmc=3D021128 From ramrom@earthling.net Wed Mar 12 16:38:05 2003 From: ramrom@earthling.net (Bob Gailer) Date: Wed, 12 Mar 2003 09:38:05 -0700 Subject: [python-win32] What happened to the ability to edit the source from PythonWin grep? Message-ID: <5.2.0.9.0.20030312093455.01a28b80@66.28.54.253> --=======6458642A======= Content-Type: text/plain; x-avg-checked=avg-ok-4B3B7BC2; charset=us-ascii; format=flowed Content-Transfer-Encoding: 8bit In previous versions of PythonWin I could left click, then right click on a result line in a grep window and choose to edit the file. In the current (win32all build 152) right click in grep always displays the same menu (Try Again, Cut, Copy, Paste, Select all, Save tesults.) BTW it also bugs me that I have to left click first to select the line, then right click. Can right-click be fixed to select the line (that's the way it works in Windows Explorer, for example). I almost always get a bunch of PythonWin exceptions when debugging. Is there a way to fix things to reduce these? Bob Gailer mailto:ramrom@earthling.net 303 442 2625 --=======6458642A======= Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-4B3B7BC2 Content-Disposition: inline --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.459 / Virus Database: 258 - Release Date: 2/25/2003 --=======6458642A=======-- From Jaleco@gameone.com.tw Fri Mar 14 06:57:12 2003 From: Jaleco@gameone.com.tw (Jaleco) Date: Fri, 14 Mar 2003 14:57:12 +0800 Subject: [python-win32] help com problem. design time attribe Message-ID: <000801c2e9f6$f0dd0b40$3df4383d@jalecoxp> This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C2EA39.FE9861B0 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable I try use a visiual basic compoent. every thing is fine. except some property "only change in design time in = visiual basic" in python , because It is in run time mode,how can I set those property? ------=_NextPart_000_0005_01C2EA39.FE9861B0 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable
I try use a visiual basic compoent.
every thing is fine. except some property "only = change in=20 design time in visiual basic"
in python , because It is in run time mode,how can I = set those=20 property?
------=_NextPart_000_0005_01C2EA39.FE9861B0-- From itamarst@yahoo.com Fri Mar 14 17:55:06 2003 From: itamarst@yahoo.com (Itamar S.-T.) Date: Fri, 14 Mar 2003 09:55:06 -0800 (PST) Subject: [python-win32] IOleCommandTarget / Print and Find dialogs in IE ActiveX control Message-ID: <20030314175506.69058.qmail@web40808.mail.yahoo.com> I need to run the Print and Find dialogs when using embedded WebBrowser. Google found: http://members.shaw.ca/iedelphi/webbrowser.htm#advanced2 But I'm really not sure how to do this in Python. Suggestions of alternate means are also welcome. Thanks! ===== Itamar Shtull-Trauring, itamar(at)shtull-trauring.org __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com From itamarst@yahoo.com Fri Mar 14 18:28:57 2003 From: itamarst@yahoo.com (Itamar S.-T.) Date: Fri, 14 Mar 2003 10:28:57 -0800 (PST) Subject: [python-win32] IOleCommandTarget / Print and Find dialogs in IE ActiveX control In-Reply-To: <20030314175506.69058.qmail@web40808.mail.yahoo.com> Message-ID: <20030314182857.97434.qmail@web40807.mail.yahoo.com> webBrowser.Document.execCommand("Print") does print, still searching for method to do Find dialog. ===== Itamar Shtull-Trauring, itamar(at)shtull-trauring.org __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com From corydodt@yahoo.com Fri Mar 14 23:42:57 2003 From: corydodt@yahoo.com (Cory Dodt) Date: Fri, 14 Mar 2003 15:42:57 -0800 (PST) Subject: [python-win32] f(win32all, COM server, py2exe) continued In-Reply-To: Message-ID: <20030314234257.89077.qmail@web10002.mail.yahoo.com> Ok, tried with your patch--pasted at the end--and registration is no longer a problem. win32traceutil gives me "Registered blah blah (for debugging)" as it should, registry key is fine (although different...) etc. Now the problem is when I run the sucker, my process (App.exe) hangs, hangs, hangs, hangs, dies. This happens as soon as I do a Dispatch from python, or for example a CreateObject in VBA. And it blocks. Fun! This is the error I get from the client side: '''pywintypes.com_error : (-2146959355, 'Server execution failed', None, None)''' I have no server-side debugging information to offer at this point. win32traceutil sits there quietly while this happens. The only thing I noticed is that the command line has changed. In the registry I used to have: HKEY_CLASSES_ROOT\CLSID\{B5772D53-62F1-4B23-902E-7DA4B9DD4902}\LocalServer32 == C:\PROGRA~1\Lexicon\App.exe {B5772D53-62F1-4B23-902E-7DA4B9DD4902} Now I have: == C:\PROGRA~1\Lexicon\App.exe /Automate --- Mark Hammond wrote: > > Point well taken about win32traceutil. I assumed it didn't work at > all in > > py2exe because I had some trouble using it that way, but importing it > > explicitly worked, and gave me the following tb: > > ... > > > File "win32com\server\register.pyc", line 188, in RegisterServer > > AttributeError: 'module' object has no attribute 'frozen' > > Having a look at this shows: > > if pythoncom.frozen: > assert sys.frozen, "pythoncom is frozen, but sys.frozen is not set - > don't know the context!" > if sys.frozen == "dll": > > In McMillan's installer, if pythoncom.frozen is set, sys.frozen will be > either 1 (for backwards compat, meaning .exe) or "dll", meaning a DLL. > register.py is trying to work out how to register itself, as these 2 > cases > are different. (Previously, McMillan, and I presume py2exe, had nasty > hacks > to perform correct registration of COM objects. It made much more sense > to > me for win32com to directly support these advanced registation > requirements. > Thus, there may be py2exe hacks that could be removed) > > If someone can suggest a change here, that would be great. For now, > simply > remove the assert, and change the following line to: > > if hasattr(sys, "frozen") and sys.frozen == "dll": > > This will force register.py to take the 'else' path here, assuming a > .exe. > Let me know if that is all that is broken. > > Mark. > --- register.py.orig 2003-03-14 15:11:10.000000000 -0800 +++ register.py 2003-03-14 15:11:24.000000000 -0800 @@ -185,8 +185,8 @@ # And if we are frozen, ignore the ones that don't make sense in this # context. if pythoncom.frozen: - assert sys.frozen, "pythoncom is frozen, but sys.frozen is not set - don't know the context!" - if sys.frozen == "dll": +# assert sys.frozen, "pythoncom is frozen, but sys.frozen is not set - don't know the context!" + if hasattr(sys, "frozen") and sys.frozen == "dll": clsctx = clsctx & pythoncom.CLSCTX_INPROC_SERVER else: clsctx = clsctx & pythoncom.CLSCTX_LOCAL_SERVER __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com From mhammond@skippinet.com.au Sat Mar 15 00:35:31 2003 From: mhammond@skippinet.com.au (Mark Hammond) Date: Sat, 15 Mar 2003 11:35:31 +1100 Subject: [python-win32] f(win32all, COM server, py2exe) continued In-Reply-To: <20030314234257.89077.qmail@web10002.mail.yahoo.com> Message-ID: > Now the problem is when I run the sucker, my process (App.exe) hangs, > hangs, hangs, hangs, dies. This happens as soon as I do a Dispatch from > python, or for example a CreateObject in VBA. And it blocks. Fun! This will be the thread-state happiness that needs to be done. win32com will attempt to acquire the thread lock immediately an object is created, andif this lock is already held, we deadlock. There are 2 options, none of which are great: * Wait for some threadstate patches to py2exe. I actually know someone who has managed to get this working, and I am hoping to get patches from him soon. * Wait for Python 2.3, where the thread-state should be much easier to manage and fix. I guess a third option would be the first option done by someone else Mark. From corydodt@yahoo.com Sat Mar 15 04:13:03 2003 From: corydodt@yahoo.com (Cory Dodt) Date: Fri, 14 Mar 2003 20:13:03 -0800 (PST) Subject: [python-win32] f(win32all, COM server, py2exe) continued In-Reply-To: Message-ID: <20030315041303.19256.qmail@web10006.mail.yahoo.com> Wish I had the time or the -foo to do the threadstate stuff, but I've never used a thread in my life. :-) And, I'm not in a hurry. I'm willing to stay on 150 as long as it takes, since that's working. What I will do is test whatever you have to test. If somebody got this working already, I could try their stuff out. --- Mark Hammond wrote: > > Now the problem is when I run the sucker, my process (App.exe) hangs, > > hangs, hangs, hangs, dies. This happens as soon as I do a Dispatch > from > > python, or for example a CreateObject in VBA. And it blocks. Fun! > > This will be the thread-state happiness that needs to be done. win32com > will attempt to acquire the thread lock immediately an object is > created, > andif this lock is already held, we deadlock. > > There are 2 options, none of which are great: > * Wait for some threadstate patches to py2exe. I actually know someone > who > has managed to get this working, and I am hoping to get patches from him > soon. > > * Wait for Python 2.3, where the thread-state should be much easier to > manage and fix. > > I guess a third option would be the first option done by someone else > > > Mark. > __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com From Jaleco@gameone.com.tw Mon Mar 17 03:06:02 2003 From: Jaleco@gameone.com.tw (Jaleco) Date: Mon, 17 Mar 2003 11:06:02 +0800 Subject: [python-win32] OCX problem Message-ID: <000f01c2ec32$2478c650$3df4383d@jalecoxp> This is a multi-part message in MIME format. ------=_NextPart_000_000C_01C2EC75.326E3F90 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: quoted-printable I use a OCX origin for VB with python. Some property which was set "in design time" in visiual basic. When I access those property , I will get "client site not avialable" Look microsoft answer, I need wait "init poperty event". I wonder How can I solve my poblem in pyhthon Jaleco ------=_NextPart_000_000C_01C2EC75.326E3F90 Content-Type: text/html; charset="big5" Content-Transfer-Encoding: quoted-printable
 I use a OCX origin for VB with = python.
Some property which was set "in design time" in = visiual=20 basic.
When I access those property , I will get "client = site not=20 avialable"
Look microsoft answer, I need wait "init poperty=20 event".
I wonder How can I solve my poblem in = pyhthon
 
 
        =    =20     Jaleco
 
------=_NextPart_000_000C_01C2EC75.326E3F90-- From itamarst@yahoo.com Mon Mar 17 20:59:54 2003 From: itamarst@yahoo.com (Itamar S.-T.) Date: Mon, 17 Mar 2003 12:59:54 -0800 (PST) Subject: [python-win32] Seeking .libs for win32all DLLs Message-ID: <20030317205954.86737.qmail@web40806.mail.yahoo.com> since no one could help me with the previous question, I'm trying to build a c extension that does what I need. However, to compile them I need pythoncom22.lib and pywintypes22.lib - where can I get them? Any reason they and the .h files aren't included with the win32all exe? ===== Itamar Shtull-Trauring, itamar(at)shtull-trauring.org __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com From gkholman@CraneSoftwrights.com Mon Mar 17 20:34:25 2003 From: gkholman@CraneSoftwrights.com (G. Ken Holman) Date: Mon, 17 Mar 2003 15:34:25 -0500 Subject: [python-win32] How to create Windows directory shortcut from Python Message-ID: <5.2.0.9.0.20030317152529.02924870@junk> Hi! I'm wondering if anyone has figured out how to create a Windows directory shortcut (Windows equivalent of a linked directory) from within a Python application. I can create a shortcut from the Windows Explorer by a right-click copy and selecting "Create Shortcuts Here" ... I'm looking for a Python solution to do the same action. I had anticipated the Windows implementation of os.symlink() would have done it, but there appears to be no implementation of os.symlink() under Windows. I could find nothing in a search of the archive of this list. Thanks for any help you can be! ................. Ken -- Upcoming hands-on in-depth XSLT/XPath and/or XSL-FO North America: June 16-20, 2003 G. Ken Holman mailto:gkholman@CraneSoftwrights.com Crane Softwrights Ltd. http://www.CraneSoftwrights.com/z/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) ISBN 0-13-065196-6 Definitive XSLT and XPath ISBN 0-13-140374-5 Definitive XSL-FO ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath ISBN 1-894049-10-1 Practical Formatting Using XSL-FO Male Breast Cancer Awareness http://www.CraneSoftwrights.com/z/bc From niki@vintech.bg Tue Mar 18 11:21:59 2003 From: niki@vintech.bg (Niki Spahiev) Date: Tue, 18 Mar 2003 13:21:59 +0200 Subject: [python-win32] Seeking .libs for win32all DLLs In-Reply-To: <20030317205954.86737.qmail@web40806.mail.yahoo.com> References: <20030317205954.86737.qmail@web40806.mail.yahoo.com> Message-ID: <3E770157.3060308@vintech.bg> Itamar S.-T. wrote: > since no one could help me with the previous question, > I'm trying to build a c extension that does what I > need. However, to compile them I need pythoncom22.lib > and pywintypes22.lib - where can I get them? Any > reason they and the .h files aren't included with the > win32all exe? If you have C++ compiler, get sources of win32all from CVS. Maybe with tag B152 (or other build). regards, Niki Spahiev From itamarst@yahoo.com Tue Mar 18 14:58:07 2003 From: itamarst@yahoo.com (Itamar S.-T.) Date: Tue, 18 Mar 2003 06:58:07 -0800 (PST) Subject: [python-win32] Seeking .libs for win32all DLLs In-Reply-To: <3E770157.3060308@vintech.bg> Message-ID: <20030318145807.23034.qmail@web40805.mail.yahoo.com> > If you have C++ compiler, get sources of win32all > from CVS. Maybe with > tag B152 (or other build). I'm rather hoping there's someone who has a precompiled version to give me? ===== Itamar Shtull-Trauring, itamar(at)shtull-trauring.org __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com From itamarst@yahoo.com Tue Mar 18 21:33:38 2003 From: itamarst@yahoo.com (Itamar S.-T.) Date: Tue, 18 Mar 2003 13:33:38 -0800 (PST) Subject: Solved - Re: [python-win32] Seeking .libs for win32all DLLs In-Reply-To: <20030317205954.86737.qmail@web40806.mail.yahoo.com> Message-ID: <20030318213338.80389.qmail@web40802.mail.yahoo.com> Turns out you don't need a .lib - just had to uncomment the pragma requiring it from pythoncom.h. If anyone is interested, I have a C extension that opens a Find Dialog for a WebBrowser activex object. __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com From gkholman@CraneSoftwrights.com Wed Mar 19 02:23:38 2003 From: gkholman@CraneSoftwrights.com (G. Ken Holman) Date: Tue, 18 Mar 2003 21:23:38 -0500 Subject: [python-win32] Re: How to create Windows directory shortcut from Python (answered) In-Reply-To: <5.2.0.9.0.20030317152529.02924870@junk> Message-ID: <5.2.0.9.0.20030318211443.02dd4e18@junk> With many thanks to Paul Prescod who related the answer to me off-list, I downloaded the Windows extensions found at: http://starship.python.net/crew/mhammond/win32/ and used the following code that created a directory shortcut on my T drive named "test" that points to the "ftemp" directory (also on T): import sys import win32com.client shell = win32com.client.Dispatch("WScript.Shell") shortcut = shell.CreateShortCut("t:\\test.lnk") shortcut.Targetpath = "t:\\ftemp" shortcut.save() Note that when I used "/" instead of "\\" in the pathnames the shortcut was *not* created properly. At 2003-03-17 15:34 -0500, I wrote: >Hi! > >I'm wondering if anyone has figured out how to create a Windows directory >shortcut (Windows equivalent of a linked directory) from within a Python >application. > >I can create a shortcut from the Windows Explorer by a right-click copy >and selecting "Create Shortcuts Here" ... I'm looking for a Python >solution to do the same action. > >I had anticipated the Windows implementation of os.symlink() would have >done it, but there appears to be no implementation of os.symlink() under >Windows. > >I could find nothing in a search of the archive of this list. > >Thanks for any help you can be! > >................. Ken -- Upcoming hands-on in-depth XSLT/XPath and/or XSL-FO North America: June 16-20, 2003 G. Ken Holman mailto:gkholman@CraneSoftwrights.com Crane Softwrights Ltd. http://www.CraneSoftwrights.com/z/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) ISBN 0-13-065196-6 Definitive XSLT and XPath ISBN 0-13-140374-5 Definitive XSL-FO ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath ISBN 1-894049-10-1 Practical Formatting Using XSL-FO Male Breast Cancer Awareness http://www.CraneSoftwrights.com/z/bc From lbates@syscononline.com Wed Mar 19 19:11:17 2003 From: lbates@syscononline.com (Larry Bates) Date: Wed, 19 Mar 2003 13:11:17 -0600 Subject: [python-win32] WTS user object setup problem using win32com.client Message-ID: <002501c2ee4b$51f62940$3f00a8c0@larrywxp> I need to set up users on NT server from information stored in database. So far I have been successful in creating the User/Password/Comments, etc. using the win32Net.NetUserAdd functions. Unfortunately there doesn't appear to be any way to set the options that I want using that method. I need to set items that are found in the Environment tab under User-Properties. The options are: TerminalServicesInitialProgram TerminalServicesWorkDirectory I found an online article and combined it with some python code I found that looked like it should work, but it doesn't. I was hoping someone could take a quick look to see why this is not working. Thanks in advance, Larry lbates@syscononline.com #--------------------------------------------- from win32com.client import GetObject import sys USERobj=GetObject("LDAP://syscon.com/CN=lab,CN=Users,DC=syscon,DC=com") print "setting User object attributes" #obj.ConnectClientDrivesAtLogon=1 #obj.ConnectClientPrintersAtLogon=1 #obj.DefaultToMainPrinter=1 obj.TerminalServicesInitialProgram="notepad.exe" obj.TerminalServicesWorkDirectory="tmp" print "saving User object" obj.SetInfo() Traceback (most recent call last): File "C:\Python22\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 301, in RunScript exec codeObject in __main__.__dict__ File "C:\python22\SYNCusers\LDAP_test1.py", line 12, in ? File "C:\Python22\Lib\site-packates\win32com\client\dynamic.py", line 482, in __setattr__ raise AttributeError, "Property '%s.%s' can not be set." % (self._username, attr) AttributeError: Property 'LDAP://syscon.com/CN=lab,CN=Users,DC=syscon, DC=com.TerminalServicesInitialProgram' can not be set. From b.hall@irl.cri.nz Fri Mar 21 04:42:10 2003 From: b.hall@irl.cri.nz (Blair Hall) Date: Fri, 21 Mar 2003 16:42:10 +1200 Subject: [python-win32] Standard Excel add-in does not load? Message-ID: <5.1.0.14.1.20030321142155.00a4e140@pop.wgtn.irl.cri.nz> If someone could help me understand what to do here, I would appreciate it. I am trying to find a way to write a complex number into an Excel cell from a Python program. To write a complex number to an Excel cell one writes : =COMPLEX(a,b) the function is supplied by a standard add-in 'Analysis Toolpak'. Now here's the problem. I have a simple script: import win32com.client import pythoncom x = win32com.client.Dispatch('Excel.Application') x.Visible = 1 wb = x.WorkBooks.Add() x.Cells.Item(1,1).Formula = '=COMPLEX(1,2)' x.Quit() x = None Which gets an instance of Excel and writes '1+2i' into the first cell and then closes. This script will only work correctly if the Excel has been opened BEFORE the script runs (ie by hand). If I let the script open Excel then the insertion of a complex number fails. The cell shows '#NAME', which suggets that the add-in has not been loaded properly. Furthermore, I cannot use (manually) any of the functions that belong to that add-in. A quick check on the Excel menu bar indicates that the add-in is selected. However, if I unselect the add-in and then re-select it, then I can get the first cell to accept the COMPLEX formula. To summarize: it appears that the standard add-in 'Analysis Toolpak' is not loaded correctly when Excel is activated by the script above. Can anyone tell me why? I am trying this on Windows95 with Excel97, Python 2.2.2 and have win32all-150 From jimmy@retzlaff.com Fri Mar 21 09:39:02 2003 From: jimmy@retzlaff.com (Jimmy Retzlaff) Date: Fri, 21 Mar 2003 01:39:02 -0800 Subject: [python-win32] Standard Excel add-in does not load? Message-ID: Blair Hall [mailto:b.hall@irl.cri.nz] wrote: ... >import win32com.client >import pythoncom >x =3D win32com.client.Dispatch('Excel.Application') >x.Visible =3D 1 >wb =3D x.WorkBooks.Add() >x.Cells.Item(1,1).Formula =3D '=3DCOMPLEX(1,2)' >x.Quit() >x =3D None ... >To summarize: it appears that the standard add-in 'Analysis Toolpak' >is not loaded correctly when Excel is activated by the script above. ... This knowledge base article demonstrates how to do it from VB: http://support.microsoft.com/default.aspx?scid=3DKB;en-us;q270844 I would imagine the same technique would work from Python. These articles talk more about the issue: http://support.microsoft.com/default.aspx?scid=3DKB;en-us;q108888 http://support.microsoft.com/default.aspx?scid=3DKB;en-us;q213489 Jimmy From ouj@usc.edu Mon Mar 24 07:46:47 2003 From: ouj@usc.edu (Jingzhao Ou) Date: Sun, 23 Mar 2003 23:46:47 -0800 (PST) Subject: [python-win32] How to handle arguments of "Pointer SafeArray Real 8 (Flags=3)" In-Reply-To: <5.2.0.9.0.20030318211443.02dd4e18@junk> Message-ID: <20030324074647.95829.qmail@web80106.mail.yahoo.com> Hi, I tried to use MATLAB from python through the MATLAB COM server. I use the following code to invoke the COM server: App = win32com.client.dynamic.Dispatch('Matlab.Application') Then, after that, I can execute MATLAB commands using App.Execute(command) However, I encountered problem when I tried to import/export data from/to MATLAB using the GetFullMatrix and PutFullMatrix functions. I check the input to these two functions. They require arguments of "Pointer SafeArray Real 8 (Flags=3)" type. I tried to use list or tuple data type in python to handle them but failed. Can anyone help me out by telling how I can solve this problem in python? Should I write some C code to solve it? BTW, VB can handle this data type. Thanks! Best regards, Jingzhao From ouj@usc.edu Mon Mar 24 07:58:30 2003 From: ouj@usc.edu (Jingzhao Ou) Date: Sun, 23 Mar 2003 23:58:30 -0800 (PST) Subject: [python-win32] How to handle arguments of "Pointer SafeArray Real 8 (Flags=3)" In-Reply-To: <20030324074647.95829.qmail@web80106.mail.yahoo.com> Message-ID: <20030324075830.94029.qmail@web80107.mail.yahoo.com> Dear all, I just checked using google. It seems that Perl guys have some good solutions to this problem. I really would like to solve this problem using Python. Thanks! Best regards, Jingzhao ============================================================ # First create two SAFE_ARRAYs (Can only pass SAFE_ARRAY?) my $MReal = Variant(VT_ARRAY|VT_R8, [1,2], 2); my $MImag = Variant(VT_ARRAY|VT_R8, [1,2], 2); # Set the values $MReal->Put(1,0,1.2345678901234567890123456789); $MReal->Put(1,1,2); $MReal->Put(2,0,3); $MReal->Put(2,1,4); # Put the matrix into MATLAB $ML->PutFullMatrix('B', 'base', $MReal, $MImag); # GetFullMatrix is similar but requires unpacking the data # from MATLAB into the Variant array. The data is passed # from MATLAB by reference. # Make real and complex arrays for the data. my $M2Real = Variant(VT_ARRAY|VT_R8|VT_BYREF, [1,2], 2); my $M2Imag = Variant(VT_ARRAY|VT_R8|VT_BYREF, [1,2], 2); # Retrieve the data from MATLAB $ML->GetFullMatrix('B', 'base', $M2Real, $M2Imag); ============================================================ --- Jingzhao Ou wrote: > Hi, > > I tried to use MATLAB from python through the MATLAB COM server. I use > the following code to invoke the COM server: > > App = win32com.client.dynamic.Dispatch('Matlab.Application') > > Then, after that, I can execute MATLAB commands using > > App.Execute(command) > > However, I encountered problem when I tried to import/export data from/to > MATLAB using the GetFullMatrix and PutFullMatrix functions. I check the input > to these two functions. They require arguments of "Pointer SafeArray Real 8 > (Flags=3)" type. I tried to use list or tuple data type in python to handle > them but failed. > > Can anyone help me out by telling how I can solve this problem in python? > Should I write some C code to solve it? > > BTW, VB can handle this data type. > > Thanks! > > Best regards, > Jingzhao > > _______________________________________________ > Python-win32 mailing list > Python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 From jens.jorgensen@tallan.com Mon Mar 24 15:59:11 2003 From: jens.jorgensen@tallan.com (Jens B. Jorgensen) Date: Mon, 24 Mar 2003 09:59:11 -0600 Subject: [python-win32] How to handle arguments of "Pointer SafeArray Real 8 (Flags=3)" In-Reply-To: <20030324074647.95829.qmail@web80106.mail.yahoo.com> References: <20030324074647.95829.qmail@web80106.mail.yahoo.com> Message-ID: <3E7F2B4F.9090407@tallan.com> You should be able to get this to work. When you say it failed in python, could you show us the code and the exceptions you got? Jingzhao Ou wrote: >Hi, > >I tried to use MATLAB from python through the MATLAB COM server. I use >the following code to invoke the COM server: > >App = win32com.client.dynamic.Dispatch('Matlab.Application') > >Then, after that, I can execute MATLAB commands using > >App.Execute(command) > >However, I encountered problem when I tried to import/export data from/to >MATLAB using the GetFullMatrix and PutFullMatrix functions. I check the input >to these two functions. They require arguments of "Pointer SafeArray Real 8 >(Flags=3)" type. I tried to use list or tuple data type in python to handle >them but failed. > >Can anyone help me out by telling how I can solve this problem in python? >Should I write some C code to solve it? > >BTW, VB can handle this data type. > >Thanks! > >Best regards, >Jingzhao > >_______________________________________________ >Python-win32 mailing list >Python-win32@python.org >http://mail.python.org/mailman/listinfo/python-win32 > > -- Jens B. Jorgensen jens.jorgensen@tallan.com "With a focused commitment to our clients and our people, we deliver value through customized technology solutions" From Matt.Wilbert@state.ma.us Wed Mar 26 18:20:49 2003 From: Matt.Wilbert@state.ma.us (Wilbert, Matt (ENV)) Date: Wed, 26 Mar 2003 13:20:49 -0500 Subject: [python-win32] python and ASP question Message-ID: <6B4AC3A142A99446A5FEA2AE28B2F05AC047EE@ES-MSG-006.es.govt.state.ma.us> I have some Python Active Directory querying code which I want to make = available to another person (who has no knowledge of Python) to use in his ASP web = pages. The big question is what kind of interface can I provide him that would = be useful, and how do I do it--for instance, he thinks it would be nice if I could pass = him a recordset with the query result in it--I have a recordset, but I don't understand = how I can pass it back to him in a way that he can use it outside of Python. Also, I am not sure this is the right idea anyway. If anyone has = suggestions I would appreciate them. Thanks, Matt Wilbert matt.wilbert@state.ma.us From charles.a.erignac@boeing.com Wed Mar 26 20:03:43 2003 From: charles.a.erignac@boeing.com (Erignac, Charles A) Date: Wed, 26 Mar 2003 12:03:43 -0800 Subject: [python-win32] Indexing COM Objects Message-ID: <67B3A7DA6591BE439001F27362333512BBB001@XCH-NW-28.nw.nos.boeing.com> I would like to use COM objects as keys for a dictionary. It seems that = they do not have the indexing property. Is one of their property a = unique indexable key? Thank you, Charles From bgailer@alum.rpi.edu Wed Mar 26 20:36:23 2003 From: bgailer@alum.rpi.edu (Bob Gailer) Date: Wed, 26 Mar 2003 13:36:23 -0700 Subject: [python-win32] Indexing COM Objects In-Reply-To: <67B3A7DA6591BE439001F27362333512BBB001@XCH-NW-28.nw.nos.bo eing.com> Message-ID: <5.2.0.9.0.20030326133503.03942428@66.28.54.253> --=======18585366======= Content-Type: text/plain; x-avg-checked=avg-ok-776F4D8A; charset=us-ascii; format=flowed Content-Transfer-Encoding: 8bit At 12:03 PM 3/26/2003 -0800, Erignac, Charles A wrote: >I would like to use COM objects as keys for a dictionary. It seems that >they do not have the indexing property. Is one of their property a unique >indexable key? AFAIK that's a nono. What are you trying to accomplish? Perhaps there's a workaround. Bob Gailer PLEASE NOTE NEW EMAIL ADDRESS bgailer@alum.rpi.edu 303 442 2625 --=======18585366======= Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-776F4D8A Content-Disposition: inline --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.463 / Virus Database: 262 - Release Date: 3/17/2003 --=======18585366=======-- From charles.a.erignac@boeing.com Wed Mar 26 21:24:28 2003 From: charles.a.erignac@boeing.com (Erignac, Charles A) Date: Wed, 26 Mar 2003 13:24:28 -0800 Subject: [python-win32] Indexing COM Objects Message-ID: <67B3A7DA6591BE439001F2736233351211E33E@XCH-NW-28.nw.nos.boeing.com> I manipulate COM objects through their Python wrapper (static dispatch). = Supposing that myObject is such an object, would id(myObject._oleobj_) = return a unique key to the underlying COM object? In other words, if I cast myObject into another wrapper class as in myOtherObject =3D Cast(myObject,myOtherClass) would myOtherObject._oleobj_ be the same object as myObject._oleobj_? Charles -----Original Message----- From: Bob Gailer [mailto:bgailer@alum.rpi.edu] Sent: Wednesday, March 26, 2003 12:36 PM To: Erignac, Charles A; python-win32@python.org Subject: Re: [python-win32] Indexing COM Objects At 12:03 PM 3/26/2003 -0800, Erignac, Charles A wrote: >I would like to use COM objects as keys for a dictionary. It seems that = >they do not have the indexing property. Is one of their property a = unique=20 >indexable key? AFAIK that's a nono. What are you trying to accomplish? Perhaps there's = a=20 workaround. Bob Gailer PLEASE NOTE NEW EMAIL ADDRESS bgailer@alum.rpi.edu 303 442 2625 From tony@tcapp.com Thu Mar 27 08:04:22 2003 From: tony@tcapp.com (Tony Cappellini) Date: Thu, 27 Mar 2003 00:04:22 -0800 Subject: [python-win32] Extreme slowness in PythonWin IDE (Build 152), after displaying big lists Message-ID: <5.1.0.14.0.20030326235730.01b66e00@smtp.sbcglobal.net> I've been having problems in the PythonWin IDE, after displaying big lists or dictionaries. Usually, only part of the list will be displayed, and the display process is very slow. After the list/dict is displayed, everything types in the IDE command line, takes much longer to execute, than it did before displaying the big list. If i close the IDE , and re-launch the IDE, it's back to normal, until I display the contents of a list of dict (several hundreds of items) This happened on a Win98 machine, with Python 2.2.2, I'll see if I can find a Win2000 machine to see if it happens there as well. The system is 667MHZ machine with 256MB ram. It seems as though the entire system system slows down a bit, after the IDE starts to crawl. Has anyone else seen anything else like this in the PythonWin IDE ? From jens.jorgensen@tallan.com Thu Mar 27 15:42:31 2003 From: jens.jorgensen@tallan.com (Jens B. Jorgensen) Date: Thu, 27 Mar 2003 09:42:31 -0600 Subject: [python-win32] Extreme slowness in PythonWin IDE (Build 152), after displaying big lists In-Reply-To: <5.1.0.14.0.20030326235730.01b66e00@smtp.sbcglobal.net> References: <5.1.0.14.0.20030326235730.01b66e00@smtp.sbcglobal.net> Message-ID: <3E831BE7.2040407@tallan.com> Yep, I see this in 2.2.1. I just avoid displaying very large chunks of data. Tony Cappellini wrote: > > > I've been having problems in the PythonWin IDE, after displaying big > lists or dictionaries. > Usually, only part of the list will be displayed, and the display > process is very slow. > After the list/dict is displayed, everything types in the IDE command > line, takes much longer to execute, than it did before displaying the > big list. > > If i close the IDE , and re-launch the IDE, it's back to normal, until > I display the contents of a list of dict (several hundreds of items) > This happened on a Win98 machine, with Python 2.2.2, I'll see if I can > find a Win2000 machine to see if it happens there as well. > The system is 667MHZ machine with 256MB ram. It seems as though the > entire system system slows down a bit, after the IDE starts to crawl. > > Has anyone else seen anything else like this in the PythonWin IDE ? > > > _______________________________________________ > Python-win32 mailing list > Python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 -- Jens B. Jorgensen jens.jorgensen@tallan.com "With a focused commitment to our clients and our people, we deliver value through customized technology solutions" From magnus@thinkware.se Fri Mar 28 11:33:52 2003 From: magnus@thinkware.se (Magnus Lycka) Date: Fri, 28 Mar 2003 12:33:52 +0100 Subject: [python-win32] Extreme slowness in PythonWin IDE (Build 152), after displaying big lists In-Reply-To: <5.1.0.14.0.20030326235730.01b66e00@smtp.sbcglobal.net> Message-ID: <5.1.0.14.0.20030328105839.02b2fe00@www.thinkware.se> At 00:04 2003-03-27 -0800, Tony Cappellini wrote: >I've been having problems in the PythonWin IDE, after displaying big lists >or dictionaries. >Usually, only part of the list will be displayed, and the display process >is very slow. >After the list/dict is displayed, everything types in the IDE command >line, takes much longer to execute, than it did before displaying the big list. I think the same is true for other Python IDEs as well. It certainly is for IDLE. In general, I think it's difficult for editors to handle very long lists. Maybe there should be some kind of line wrap function (optional) in PythonWin, so that the result of something like "from wxPython import wx; dir(wx)" would be displayed over several lines, and not jut be partly displayed on one line... -- Magnus Lycka, Thinkware AB Alvans vag 99, SE-907 50 UMEA, SWEDEN phone: int+46 70 582 80 65, fax: int+46 70 612 80 65 http://www.thinkware.se/ mailto:magnus@thinkware.se From Matt.Wilbert@state.ma.us Fri Mar 28 12:58:43 2003 From: Matt.Wilbert@state.ma.us (Wilbert, Matt (ENV)) Date: Fri, 28 Mar 2003 07:58:43 -0500 Subject: [python-win32] python and ASP question Message-ID: <6B4AC3A142A99446A5FEA2AE28B2F05A19C548@ES-MSG-006.es.govt.state.ma.us> SmFuZXosDQogDQpJIHRoaW5rIHRoYXQgaXMgYSBnb29kIGlkZWEsIGFuZCBJIHRhbGtlZCB0byB0 aGUgV2ViIGRlc2lnbmVyIGFuZCBoZSBsaWtlZA0KdGhhdCBpZGVhIHRvbywgc28gSSBoYXZlIHN0 YXJ0ZWQgd29ya2luZyBvbiBkb2luZyBpdCB0aGF0IHdheSAocGFzc2luZyBYTUwsIA0KZGlkbid0 IGNvbnNpZGVyIFhNTC1SUEMgeWV0KS4gIEkgd2lsbCBjZXJ0YWlubHkgbG9vayBhdCB5b3VyIGV4 YW1wbGVzLg0KIA0KVGhhbmtzIGZvciB5b3VyIGhlbHAsLg0KIA0KTWF0dA0KDQoJLS0tLS1Pcmln aW5hbCBNZXNzYWdlLS0tLS0gDQoJRnJvbTogSmFuZXogSmVyZSBbbWFpbHRvOmphbmV6LmplcmVA dm9pZC5zaV0gDQoJU2VudDogRnJpIDMvMjgvMjAwMyA0OjI4IEFNIA0KCVRvOiBXaWxiZXJ0LCBN YXR0IChFTlYpOyBweXRob24td2luMzJAcHl0aG9uLm9yZyANCglDYzogDQoJU3ViamVjdDogUkU6 IFtweXRob24td2luMzJdIHB5dGhvbiBhbmQgQVNQIHF1ZXN0aW9uDQoJDQoJDQoNCgl3aGF0IGFi b3V0IHhtbD8gb3IgeG1sLXJwYz8NCgkNCglpIGhhdmUgYSB3b3JraW5nIGV4YW1wbGVzIGluIGh0 dHA6Ly9mcmVld2ViLnNpb2wubmV0L3ZvaWRjb25uL2pqL3B5YXNwDQoJDQoJcHlhc3AtMC4yLnpp cCAvdGVzdC9hZG9fcmVjb3Jkc2V0LmFzcA0KCQ0KCQ0KCUphbmV6DQoJLS0tLS1PcmlnaW5hbCBN ZXNzYWdlLS0tLS0NCglGcm9tOiBweXRob24td2luMzItYWRtaW5AcHl0aG9uLm9y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IHN1Z2dlc3Rpb25zDQoJSSB3b3VsZA0K CWFwcHJlY2lhdGUgdGhlbS4NCgkNCglUaGFua3MsDQoJDQoJTWF0dCBXaWxiZXJ0DQoJbWF0dC53 aWxiZXJ0QHN0YXRlLm1hLnVzDQoJDQoJX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX18NCglQeXRob24td2luMzIgbWFpbGluZyBsaXN0DQoJUHl0aG9uLXdpbjMy QHB5dGhvbi5vcmcNCglodHRwOi8vbWFpbC5weXRob24ub3JnL21haWxtYW4vbGlzdGluZm8vcHl0 aG9uLXdpbjMyDQoJDQoJDQoJDQoNCg== From lbates@syscononline.com Fri Mar 28 20:46:13 2003 From: lbates@syscononline.com (Larry Bates) Date: Fri, 28 Mar 2003 14:46:13 -0600 Subject: [python-win32] py2exe'd service not working Message-ID: <012d01c2f56b$12ead1c0$3f00a8c0@larrywxp> I have read everything and am now at a dead end. I have written a service that works fine when Python is installed. I wanted to use py2exe to make .EXE so it can be installed without full Python install. I copy the files the py2exe puts out to new machine. py2exe documentation says that I should then run application with '-register' as argument to register the service. When I do this I get the following: C:\Program Files\SYNCusers>SYNCusersService -register Traceback (most recent call last): File "", line 501, in ? File "win32serviceutil.pyc", line 433, in HandleCommandLine File "win32serviceutil.pyc", line 383, in GetServiceClassString IndexError: list index out of range What's REALLY weird is that the .EXE service runs in debug mode (-debug) just as expected, I just can't register or start it (either manually or under Services Manager). I'm running following: PythonWin 2.2.2 (#37, Nov 26 2002, 10:24:37) [MSC 32 bit (Intel)] on win32 py2exe-0.3.3 (with --service SYNCusersService switch) Thanks in advance for any assistance. Regards, Larry Bates From paul@prescod.net Sun Mar 30 07:04:54 2003 From: paul@prescod.net (Paul Prescod) Date: Sat, 29 Mar 2003 23:04:54 -0800 Subject: [python-win32] Web-embeddable ActiveX Message-ID: <3E869716.1010903@prescod.net> I was writing up a tutorial on how to embed Python binary COM controls in web pages when I realized that I had only experienced "success" because I had registered the control. Really, the web-embedded control wasn't being downloaded at all. I need it to work in a download, like this: I have a feeling that maybe I need an Installer built with this patch: http://trixie.triqs.com/pipermail/installer/2002-December/000233.html Is that the problem? Let's say I build or borrow an appropriate set of binaries, should I then expect that the right way to do this is to build a CAB with cabarc or to build a monolithic DLL that represents the whole control? Paul Prescod From juerg_schulthess@tuergass.net Thu Mar 27 10:17:01 2003 From: juerg_schulthess@tuergass.net (=?ISO-8859-1?Q?J=FCrg?= Schulthess) Date: 27 Mar 2003 18:17:01 +0800 Subject: [python-win32] Acrobat Reader and win32com? Message-ID: <1048760226.2487.4.camel@ch-phantom-l> Hi, Has anyone tried to automate Acrobat Reader with win32com in the same way the documentation sugests for Word or other MS Office applications? There doesn't seem to be a type library for Acrobat Reader, or is there? Any sugestions? From janez.jere@void.si Fri Mar 28 09:28:41 2003 From: janez.jere@void.si (Janez Jere) Date: Fri, 28 Mar 2003 10:28:41 +0100 Subject: [python-win32] python and ASP question In-Reply-To: <6B4AC3A142A99446A5FEA2AE28B2F05AC047EE@ES-MSG-006.es.govt.state.ma.us> Message-ID: what about xml? or xml-rpc? i have a working examples in http://freeweb.siol.net/voidconn/jj/pyasp pyasp-0.2.zip /test/ado_recordset.asp Janez -----Original Message----- From: python-win32-admin@python.org [mailto:python-win32-admin@python.org]On Behalf Of Wilbert, Matt (ENV) Sent: Wednesday, March 26, 2003 7:21 PM To: python-win32@python.org Subject: [python-win32] python and ASP question I have some Python Active Directory querying code which I want to make available to another person (who has no knowledge of Python) to use in his ASP web pages. The big question is what kind of interface can I provide him that would be useful, and how do I do it--for instance, he thinks it would be nice if I could pass him a recordset with the query result in it--I have a recordset, but I don't understand how I can pass it back to him in a way that he can use it outside of Python. Also, I am not sure this is the right idea anyway. If anyone has suggestions I would appreciate them. Thanks, Matt Wilbert matt.wilbert@state.ma.us _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32 From robin@reportlab.com Mon Mar 31 09:50:40 2003 From: robin@reportlab.com (Robin Becker) Date: Mon, 31 Mar 2003 10:50:40 +0100 Subject: [python-win32] Acrobat Reader and win32com? In-Reply-To: <1048760226.2487.4.camel@ch-phantom-l> References: <1048760226.2487.4.camel@ch-phantom-l> Message-ID: In message <1048760226.2487.4.camel@ch-phantom-l>, Jürg Schulthess writes >Hi, >Has anyone tried to automate Acrobat Reader with win32com in the same >way the documentation sugests for Word or other MS Office applications? >There doesn't seem to be a type library for Acrobat Reader, or is there? >Any sugestions? I have done some work with this, to get anywhere you need the SDK, but there's a tlb for Acrobat 4.0 and a whole bunch of com interfaces. Unfortunately the thing I wanted to do seemed to be impossible ie bring up a particular page view it at a specified magnification, use /Fbot's screen grabber to capture the image and save it for comparison. The difficulty was in the timing ie knowing when the operations had actually completed, just because you ask to switch to full screen mode and the com method returns doesn't mean that the event has completed. -- Robin Becker From itamarst@yahoo.com Mon Mar 31 15:49:08 2003 From: itamarst@yahoo.com (Itamar S.-T.) Date: Mon, 31 Mar 2003 07:49:08 -0800 (PST) Subject: [python-win32] Embedded WebBrowser, take 3 - MFC embedding issues Message-ID: <20030331154908.87057.qmail@web40811.mail.yahoo.com> So, now I need to take my wxPython/win32all embedded WebBrowser, and get it so that when I press tab or shift-tab inside it, it switches between the HTML page's widgets as expected. http://www.microsoft.com/mind/0499/faq/faq0499.asp seems to explain how to do so: BOOL CMyView::PreTranslateMessage(MSG* pMsg) { if (IsDialogMessage(pMsg)) return TRUE; else return CWnd::PreTranslateMessage(pMsg); } So I guess this means my subclass needs to do this? I.e. override the PreTranslateMessage method in my activex.Control? ===== Itamar Shtull-Trauring, itamar(at)shtull-trauring.org __________________________________________________ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com