From eryksun at gmail.com Mon Feb 1 04:26:01 2016 From: eryksun at gmail.com (eryk sun) Date: Mon, 1 Feb 2016 03:26:01 -0600 Subject: [python-win32] Problem registering COM server at installation time In-Reply-To: <3fd7e460-7f6d-4373-368b-117569b6decf@gmail.com> References: <569A9F56.3000002@berlin.de> <3fd7e460-7f6d-4373-368b-117569b6decf@gmail.com> Message-ID: On Sun, Jan 31, 2016 at 10:42 PM, Mark Hammond wrote: > On 17/01/2016 6:51 AM, Malte Forkel wrote: >> >> I'm trying the register a COM server using the install script of a built >> distribution, created with the bdist_wininst format of distutils. But >> the script fails with a message that MSVCR90.dll can't be found. >> Registering the server after the installer is done works fine. I'm using >> Python 2.7.11 and pywin32-220 on Windows 7.1 64 bit. > > That sounds a little strange - the script should only be executed after > python27.dll is loaded, which itself relies on msvcr90.dll. > > Does it happen to work if you put the installer executable in the same > directory as python27.dll? Loading msvcr90.dll requires a SxS activation context. Neither pythoncom27.dll nor pywintypes27.dll have this assembly embedded as resource #2. I assume that's because they're normally loaded as extension modules. In this case Python uses the activation context that gets saved in its DllMain, which includes the VC90 assembly from the #2 manifest that's embedded in python27.dll. Are these two DLLs getting loaded in some other way here? If so you can create a context at runtime from the manifest that's embedded in python27.dll. pythoncomloader27.dll can load msvcr90.dll because it has the following manifest embedded as resource #2: From framstag at rus.uni-stuttgart.de Mon Feb 1 15:27:34 2016 From: framstag at rus.uni-stuttgart.de (Ulli Horlacher) Date: Mon, 1 Feb 2016 21:27:34 +0100 Subject: [python-win32] SmartScreen Message-ID: <20160201202734.GA16168@rus.uni-stuttgart.de> When I compile my Python program with PyInstaller and give it to a user with Windows 8.1 he gets the warning: Windows protected your PC Windows SmartScreen prevented an unrecognized app from starting. Publisher: Unknown Publisher App: fexit.exe How can I prevent this message which confuses my users? -- Ullrich Horlacher Server und Virtualisierung Rechenzentrum IZUS/TIK E-Mail: horlacher at tik.uni-stuttgart.de Universitaet Stuttgart Tel: ++49-711-68565868 Allmandring 30a Fax: ++49-711-682357 70550 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/ REF:<20160201202734.GA16168 at rus.uni-stuttgart.de> From bhood2 at comcast.net Mon Feb 1 16:05:51 2016 From: bhood2 at comcast.net (Bob Hood) Date: Mon, 1 Feb 2016 14:05:51 -0700 Subject: [python-win32] SmartScreen In-Reply-To: <20160201202734.GA16168@rus.uni-stuttgart.de> References: <20160201202734.GA16168@rus.uni-stuttgart.de> Message-ID: <56AFC8AF.2040308@comcast.net> On 2/1/2016 1:27 PM, Ulli Horlacher wrote: > When I compile my Python program with PyInstaller and give it to a user > with Windows 8.1 he gets the warning: > > Windows protected your PC > > Windows SmartScreen prevented an unrecognized app from starting. > > Publisher: Unknown Publisher > App: fexit.exe > > How can I prevent this message which confuses my users? You can either sign your executable using the signtool and a certificate from a trusted source (which costs $$$), or you can have the user allow installation of applications from "untrusted" sources; e.g.: http://visihow.com/Allow_Installation_of_Apps_from_Unknown_Sources_in_Windows_8 From mhammond at skippinet.com.au Mon Feb 1 17:24:31 2016 From: mhammond at skippinet.com.au (Mark Hammond) Date: Tue, 2 Feb 2016 09:24:31 +1100 Subject: [python-win32] Problem registering COM server at installation time In-Reply-To: <56AFD995.4000209@berlin.de> References: <569A9F56.3000002@berlin.de> <3fd7e460-7f6d-4373-368b-117569b6decf@gmail.com> <56AFD995.4000209@berlin.de> Message-ID: Eryk's reply is right on the money - I'd forgotten about that. IIRC, having that manifest directly in pythoncomxx.dll or pywintypesxx.dll ended up using a different activation context, which had its own problems; that loader module exists purely to work around these problems. I'm still a bit confused as to why bdist_wininst isn't working for you when that's the exact same stub used by the pywin32 installer, which obviously does manage to load Python ok. (The good-ish news is that later MSVC versions no longer have this stupid requirement, but that doesn't help the 2.x series) Mark On 2/02/2016 9:17 AM, Malte Forkel wrote: > Am 01.02.2016 um 05:42 schrieb Mark Hammond: >> On 17/01/2016 6:51 AM, Malte Forkel wrote: >>> Hi, >>> >>> I'm trying the register a COM server using the install script of a built >>> distribution, created with the bdist_wininst format of distutils. But >>> the script fails with a message that MSVCR90.dll can't be found. >>> Registering the server after the installer is done works fine. I'm using >>> Python 2.7.11 and pywin32-220 on Windows 7.1 64 bit. >> >> That sounds a little strange - the script should only be executed >> after python27.dll is loaded, which itself relies on msvcr90.dll. >> >> Does it happen to work if you put the installer executable in the same >> directory as python27.dll? >> >> Mark > > Yes, same problem if the installer is run from C:\Windows\System32. > > Malte > From malte.forkel at berlin.de Mon Feb 1 17:17:57 2016 From: malte.forkel at berlin.de (Malte Forkel) Date: Mon, 1 Feb 2016 23:17:57 +0100 Subject: [python-win32] Problem registering COM server at installation time In-Reply-To: <3fd7e460-7f6d-4373-368b-117569b6decf@gmail.com> References: <569A9F56.3000002@berlin.de> <3fd7e460-7f6d-4373-368b-117569b6decf@gmail.com> Message-ID: <56AFD995.4000209@berlin.de> Am 01.02.2016 um 05:42 schrieb Mark Hammond: > On 17/01/2016 6:51 AM, Malte Forkel wrote: >> Hi, >> >> I'm trying the register a COM server using the install script of a built >> distribution, created with the bdist_wininst format of distutils. But >> the script fails with a message that MSVCR90.dll can't be found. >> Registering the server after the installer is done works fine. I'm using >> Python 2.7.11 and pywin32-220 on Windows 7.1 64 bit. > > That sounds a little strange - the script should only be executed > after python27.dll is loaded, which itself relies on msvcr90.dll. > > Does it happen to work if you put the installer executable in the same > directory as python27.dll? > > Mark Yes, same problem if the installer is run from C:\Windows\System32. Malte From malte.forkel at berlin.de Mon Feb 1 17:40:24 2016 From: malte.forkel at berlin.de (Malte Forkel) Date: Mon, 1 Feb 2016 23:40:24 +0100 Subject: [python-win32] Problem registering COM server at installation time In-Reply-To: References: <569A9F56.3000002@berlin.de> <3fd7e460-7f6d-4373-368b-117569b6decf@gmail.com> Message-ID: <56AFDED8.6070002@berlin.de> Am 01.02.2016 um 10:26 schrieb eryk sun: > On Sun, Jan 31, 2016 at 10:42 PM, Mark Hammond wrote: >> On 17/01/2016 6:51 AM, Malte Forkel wrote: >>> I'm trying the register a COM server using the install script of a built >>> distribution, created with the bdist_wininst format of distutils. But >>> the script fails with a message that MSVCR90.dll can't be found. >>> Registering the server after the installer is done works fine. I'm using >>> Python 2.7.11 and pywin32-220 on Windows 7.1 64 bit. >> That sounds a little strange - the script should only be executed after >> python27.dll is loaded, which itself relies on msvcr90.dll. >> >> Does it happen to work if you put the installer executable in the same >> directory as python27.dll? > Loading msvcr90.dll requires a SxS activation context. Neither > pythoncom27.dll nor pywintypes27.dll have this assembly embedded as > resource #2. I assume that's because they're normally loaded as > extension modules. In this case Python uses the activation context > that gets saved in its DllMain, which includes the VC90 assembly from > the #2 manifest that's embedded in python27.dll. Are these two DLLs > getting loaded in some other way here? If so you can create a context > at runtime from the manifest that's embedded in python27.dll. > > pythoncomloader27.dll can load msvcr90.dll because it has the > following manifest embedded as resource #2: > > > > > > > uiAccess="false"> > > > > > > version="9.0.21022.8" processorArchitecture="amd64" publi > cKeyToken="1fc8b3b9a1e18e3b"> > > > > To me, that sounds similar to bug report #705, Missing MSVCR90.DLL under 'boost::python' application [1]. Its authors writes By the way, I added the same manifest that it is in "pythoncomloader27.dll" in to "pywintypes27.dll" and "pythoncom27.dll" and the error message does not appear any more." Unfortunately, I don't have the Windows skills to follow his advice or yours. How do I "create a context at runtime from the manifest that's embedded in python27.dll"? Malte [1] http://sourceforge.net/p/pywin32/bugs/705/ From Vish.Srinivasa at elavon.com Tue Feb 2 08:23:10 2016 From: Vish.Srinivasa at elavon.com (Srinivasa, Vish) Date: Tue, 2 Feb 2016 13:23:10 +0000 Subject: [python-win32] Unsubscribe Message-ID: <2AA1201C0ED0A340BD96784C749D321448721609@SPPATLXCHMBX01.servers.global.prv> Thanks Vish Rao The information contained in this e-mail and in any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. This message has been scanned for known computer viruses. -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Tue Feb 2 13:38:08 2016 From: timr at probo.com (Tim Roberts) Date: Tue, 2 Feb 2016 10:38:08 -0800 Subject: [python-win32] Unsubscribe In-Reply-To: <2AA1201C0ED0A340BD96784C749D321448721609@SPPATLXCHMBX01.servers.global.prv> References: <2AA1201C0ED0A340BD96784C749D321448721609@SPPATLXCHMBX01.servers.global.prv> Message-ID: <56B0F790.90701@probo.com> To unsubscribe, visit the link at the bottom of every message, or send your "unsubscribe" message to python-win32-leave at python.org . -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From ram at rachum.com Sun Feb 7 12:37:06 2016 From: ram at rachum.com (Ram Rachum) Date: Sun, 7 Feb 2016 19:37:06 +0200 Subject: [python-win32] Figuring out why a window is losing focus Message-ID: Hi everybody, There's a problem in my Windows 7 machine that I want to diagnose using Python. Once in a while, I'm noticing that focus is being stolen from the active window and then immediately given back. For example, right now as I'm writing this message to you in GMail, I see that the window title, once in about 5 seconds, changes its color rapidly from active to inactive and then to active again. This happens not only in Chrome but in any program. It doesn't always happen, but it's been happening on some days during the last few months. This is really annoying because if I opened a dropdown, for example, this action makes the dropdown disappear. Another example is that if I'm renaming a file in explorer, when the event happens it's as if I pressed "enter" and the file gets the partial name before I finished typing. I'm guessing that some app that's installed on my computer is causing this, but I don't know which one. I want to use Python to figure out which one. I want to set Python up to listen to WM_ACTIVATE events (or any other kind of events? Please let me know) and write a log saying which program the focus was passed to. I'm hoping that this way I can find the offending program. I have no idea how to write a thing like this in Python, and whether this is even possible. Can you please help me? Thanks for your help, Ram Rachum. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zturner at google.com Sun Feb 7 15:39:48 2016 From: zturner at google.com (Zachary Turner) Date: Sun, 07 Feb 2016 20:39:48 +0000 Subject: [python-win32] Figuring out why a window is losing focus In-Reply-To: References: Message-ID: Why do you need to use Python? Sounds like this is done very easily with Spy++ On Sun, Feb 7, 2016 at 10:12 AM Ram Rachum wrote: > Hi everybody, > > There's a problem in my Windows 7 machine that I want to diagnose using > Python. > > Once in a while, I'm noticing that focus is being stolen from the active > window and then immediately given back. For example, right now as I'm > writing this message to you in GMail, I see that the window title, once in > about 5 seconds, changes its color rapidly from active to inactive and then > to active again. This happens not only in Chrome but in any program. It > doesn't always happen, but it's been happening on some days during the last > few months. This is really annoying because if I opened a dropdown, for > example, this action makes the dropdown disappear. Another example is that > if I'm renaming a file in explorer, when the event happens it's as if I > pressed "enter" and the file gets the partial name before I finished > typing. > > I'm guessing that some app that's installed on my computer is causing > this, but I don't know which one. I want to use Python to figure out which > one. I want to set Python up to listen to WM_ACTIVATE events (or any other > kind of events? Please let me know) and write a log saying which program > the focus was passed to. I'm hoping that this way I can find the offending > program. > > I have no idea how to write a thing like this in Python, and whether this > is even possible. Can you please help me? > > > Thanks for your help, > Ram Rachum. > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mbrahimi02 at gmail.com Sun Feb 7 15:45:07 2016 From: mbrahimi02 at gmail.com (Malik Brahimi) Date: Sun, 7 Feb 2016 15:45:07 -0500 Subject: [python-win32] Handling Print Events Message-ID: Hello guys, So basically, a print job (.SPL file) is generated during local spooling as soon as a document is requested to print. I do NOT want to handle this event. I want to trigger a callback function as soon as a print job reaches a print server regardless of whether it begins to immediately print there or not. Essentially, even on a high volume network, I want to catch the even in which the print job reaches the print server, not the event in which the print job is initially created. Is there anyway to do that with Python? I would also like to get the JobId of said print job as this event is caught. http://stackoverflow.com/questions/35228080/print-servers-and-triggering-callbacks http://stackoverflow.com/questions/34519642/received-print-job-python Thanks, Malik -------------- next part -------------- An HTML attachment was scrubbed... URL: From ram at rachum.com Sun Feb 7 16:19:31 2016 From: ram at rachum.com (Ram Rachum) Date: Sun, 7 Feb 2016 23:19:31 +0200 Subject: [python-win32] Figuring out why a window is losing focus In-Reply-To: References: Message-ID: Thanks for the reference to Spy++! I'm checking it out and it looks like a useful program. But I don't understand, how do I use it to accomplish what I wanted? On Sun, Feb 7, 2016 at 10:39 PM, Zachary Turner wrote: > Why do you need to use Python? Sounds like this is done very easily with > Spy++ > > On Sun, Feb 7, 2016 at 10:12 AM Ram Rachum wrote: > >> Hi everybody, >> >> There's a problem in my Windows 7 machine that I want to diagnose using >> Python. >> >> Once in a while, I'm noticing that focus is being stolen from the active >> window and then immediately given back. For example, right now as I'm >> writing this message to you in GMail, I see that the window title, once in >> about 5 seconds, changes its color rapidly from active to inactive and then >> to active again. This happens not only in Chrome but in any program. It >> doesn't always happen, but it's been happening on some days during the last >> few months. This is really annoying because if I opened a dropdown, for >> example, this action makes the dropdown disappear. Another example is that >> if I'm renaming a file in explorer, when the event happens it's as if I >> pressed "enter" and the file gets the partial name before I finished >> typing. >> >> I'm guessing that some app that's installed on my computer is causing >> this, but I don't know which one. I want to use Python to figure out which >> one. I want to set Python up to listen to WM_ACTIVATE events (or any other >> kind of events? Please let me know) and write a log saying which program >> the focus was passed to. I'm hoping that this way I can find the offending >> program. >> >> I have no idea how to write a thing like this in Python, and whether this >> is even possible. Can you please help me? >> >> >> Thanks for your help, >> Ram Rachum. >> _______________________________________________ >> python-win32 mailing list >> python-win32 at python.org >> https://mail.python.org/mailman/listinfo/python-win32 >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zturner at google.com Sun Feb 7 16:55:37 2016 From: zturner at google.com (Zachary Turner) Date: Sun, 07 Feb 2016 21:55:37 +0000 Subject: [python-win32] Figuring out why a window is losing focus In-Reply-To: References: Message-ID: You can log the messages going to a particular window. Just click Spy -> Log Messages. But it occurred to me you want to know *which* process is sending the message. I don't believe there's a way to do that short of hooking the native PostMessage and SendMessage Win32 APIs in every process running on the system. On Sun, Feb 7, 2016 at 1:19 PM Ram Rachum wrote: > Thanks for the reference to Spy++! I'm checking it out and it looks like a > useful program. But I don't understand, how do I use it to accomplish what > I wanted? > > On Sun, Feb 7, 2016 at 10:39 PM, Zachary Turner > wrote: > >> Why do you need to use Python? Sounds like this is done very easily with >> Spy++ >> >> On Sun, Feb 7, 2016 at 10:12 AM Ram Rachum wrote: >> >>> Hi everybody, >>> >>> There's a problem in my Windows 7 machine that I want to diagnose using >>> Python. >>> >>> Once in a while, I'm noticing that focus is being stolen from the active >>> window and then immediately given back. For example, right now as I'm >>> writing this message to you in GMail, I see that the window title, once in >>> about 5 seconds, changes its color rapidly from active to inactive and then >>> to active again. This happens not only in Chrome but in any program. It >>> doesn't always happen, but it's been happening on some days during the last >>> few months. This is really annoying because if I opened a dropdown, for >>> example, this action makes the dropdown disappear. Another example is that >>> if I'm renaming a file in explorer, when the event happens it's as if I >>> pressed "enter" and the file gets the partial name before I finished >>> typing. >>> >>> I'm guessing that some app that's installed on my computer is causing >>> this, but I don't know which one. I want to use Python to figure out which >>> one. I want to set Python up to listen to WM_ACTIVATE events (or any other >>> kind of events? Please let me know) and write a log saying which program >>> the focus was passed to. I'm hoping that this way I can find the offending >>> program. >>> >>> I have no idea how to write a thing like this in Python, and whether >>> this is even possible. Can you please help me? >>> >>> >>> Thanks for your help, >>> Ram Rachum. >>> _______________________________________________ >>> python-win32 mailing list >>> python-win32 at python.org >>> https://mail.python.org/mailman/listinfo/python-win32 >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Mon Feb 8 12:46:01 2016 From: timr at probo.com (Tim Roberts) Date: Mon, 8 Feb 2016 09:46:01 -0800 Subject: [python-win32] Handling Print Events In-Reply-To: References: Message-ID: <56B8D459.4080603@probo.com> Malik Brahimi wrote: > > So basically, a print job (.SPL file) is generated during local > spooling as soon as a document is requested to print. I do NOT want to > handle this event. > > I want to trigger a callback function as soon as a print job reaches a > print server regardless of whether it begins to immediately print > there or not. Essentially, even on a high volume network, I want to > catch the even in which the print job reaches the print server, not > the event in which the print job is initially created. > > Is there anyway to do that with Python? I would also like to get the > JobId of said print job as this event is caught. Probably the best you can do is poll using EnumJobs and watch the status of the job change. There are no callbacks, at least at the application level. Here's the link to the Windows spooler APIs: https://msdn.microsoft.com/en-us/library/windows/desktop/dd162861.aspx -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From reckoner at gmail.com Mon Feb 8 22:32:52 2016 From: reckoner at gmail.com (reckoner) Date: Mon, 8 Feb 2016 19:32:52 -0800 Subject: [python-win32] Figuring out why a window is losing focus In-Reply-To: References: Message-ID: <56B95DE4.9090006@gmail.com> Where can I safely download this Spy program you are all talking about? Thanks! On 2/8/2016 9:00 AM, python-win32-request at python.org wrote: > Re: Figuring out why a window is losing focus From zturner at google.com Mon Feb 8 22:56:05 2016 From: zturner at google.com (Zachary Turner) Date: Tue, 09 Feb 2016 03:56:05 +0000 Subject: [python-win32] Figuring out why a window is losing focus In-Reply-To: <56B95DE4.9090006@gmail.com> References: <56B95DE4.9090006@gmail.com> Message-ID: It's included as part of Visual Studio. Download community edition, it should be there. On Mon, Feb 8, 2016 at 7:33 PM reckoner wrote: > > Where can I safely download this Spy program you are all talking about? > > Thanks! > > > > On 2/8/2016 9:00 AM, python-win32-request at python.org wrote: > > Re: Figuring out why a window is losing focus > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From JakkampudiKiranKumar at Eaton.com Tue Feb 16 03:28:49 2016 From: JakkampudiKiranKumar at Eaton.com (JakkampudiKiranKumar at Eaton.com) Date: Tue, 16 Feb 2016 08:28:49 +0000 Subject: [python-win32] pywintypes Error Message-ID: <17FDE7AA545E5543B57F5C8F7EABEAAC1349C7BB@SIMTCSMB12.napa.ad.etn.com> Hi , I am getting an error mentioned below while using in some of the machines when trying to open the application where as it is working fine in some of the machines : I also tried to create the Class id manually using the reg-edit but it didn't worked. I am using win-7 32 bit OS , python 2.4.4,Pmw module and pywin ,pyinstaller,pythoncom..etc Can you suggest how to force the class Id in to valid string either through code or manually by dll registration? Can anyone please help me to figure it out? [cid:image003.jpg at 01D168C2.27C374C0] Thanks! Kiran -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.jpg Type: image/jpeg Size: 41706 bytes Desc: image003.jpg URL: From JakkampudiKiranKumar at Eaton.com Tue Feb 16 05:59:57 2016 From: JakkampudiKiranKumar at Eaton.com (JakkampudiKiranKumar at Eaton.com) Date: Tue, 16 Feb 2016 10:59:57 +0000 Subject: [python-win32] Com error invalid class string Message-ID: <17FDE7AA545E5543B57F5C8F7EABEAAC1349C7FD@SIMTCSMB12.napa.ad.etn.com> Hi , I am trying to run a python application which is leaving trackback as shown below . I am using windows -7 32 bit O.S,python 2.4.4,pywin32 214 [cid:image001.png at 01D16812.2775B2E0] Can anyone help in figuring out the issue? Thanks in advance Thanks! Kiran -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 39454 bytes Desc: image001.png URL: From timr at probo.com Tue Feb 16 12:15:11 2016 From: timr at probo.com (Tim Roberts) Date: Tue, 16 Feb 2016 09:15:11 -0800 Subject: [python-win32] pywintypes Error In-Reply-To: <17FDE7AA545E5543B57F5C8F7EABEAAC1349C7BB@SIMTCSMB12.napa.ad.etn.com> References: <17FDE7AA545E5543B57F5C8F7EABEAAC1349C7BB@SIMTCSMB12.napa.ad.etn.com> Message-ID: <56C3591F.8090505@probo.com> JakkampudiKiranKumar at Eaton.com wrote: > > > I am getting an error mentioned below while using in some of the > machines when trying to open the application where as it is working > fine in some of the machines : > > > > I also tried to create the Class id manually using the reg-edit but it > didn?t worked. > > I am using win-7 32 bit OS , python 2.4.4,Pmw module and pywin > ,pyinstaller,pythoncom..etc > > Can you suggest how to force the class Id in to valid string either > through code or manually by dll registration? > > Can anyone please help me to figure it out? > You have to have the COM server register itself. You didn't post any code, so we can't tell which class it is. Assuming you know which DLL it is, just run "regsvr32 xxxx.dll". -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Tue Feb 16 12:18:10 2016 From: timr at probo.com (Tim Roberts) Date: Tue, 16 Feb 2016 09:18:10 -0800 Subject: [python-win32] Com error invalid class string In-Reply-To: <17FDE7AA545E5543B57F5C8F7EABEAAC1349C7FD@SIMTCSMB12.napa.ad.etn.com> References: <17FDE7AA545E5543B57F5C8F7EABEAAC1349C7FD@SIMTCSMB12.napa.ad.etn.com> Message-ID: <56C359D2.408@probo.com> JakkampudiKiranKumar at Eaton.com wrote: > > > > > I am trying to run a python application which is leaving trackback as > shown below . > > I am using windows -7 32 bit O.S,python 2.4.4,pywin32 214 > > ... > > Can anyone help in figuring out the issue? > I don't know how you can expect anyone to help when you don't show the code. The issue is very clear -- the class string in the call to Dispatch is not a registered class. So, go look up what ID_SETUP_DONGLE is, figure out which DLL is the server for that class, and register it. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From indranil_leo at yahoo.com Thu Feb 18 18:36:37 2016 From: indranil_leo at yahoo.com (Indranil Sinharoy) Date: Thu, 18 Feb 2016 17:36:37 -0600 Subject: [python-win32] Problem: methods defined in type library's base class are not accessible in inherited class objects of the type library Message-ID: <56C65585.6070401@yahoo.com> Hi all, I am a relatively new user of pywin32 package, but not Python. I have an application (written in C/#, as I understand) that provides a COM interface for using with other languages such as Python. I am using the pywin32 library to communicate with the application and it works fairly well. However, I am facing a particular kind of problem. The problem is that the application exposes some interface objects that inherit from other base objects but the methods defined in the base class objects doesn't seem to be accessible to the child class object. Is this type of behavior is atypical with pywin32? If so, what is the recommended way of addressing this problem? Currently, I am patching these methods in the child class object and delegating the calls to the parent object (using CastTo)) as shown in the pseudo-code below: class MyBaseClass: ... ... def my_parent_method(self): base = win32com.client.CastTo(self, 'MyParentClass') return base.my_parent_method() ... Although this strategy works, I would like to find out if there is a more efficient/ automatic way of resolving this issue. In my particular case, there are a large number of such objects (that inherit from some base class without access to the methods defined in the parent class) provided by the application and I would like to avoid re-writing all the methods for all such objects. I hope I have been able to explain my problem well. Thank you very much, Best regards, Indranil. -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Fri Feb 19 17:19:52 2016 From: timr at probo.com (Tim Roberts) Date: Fri, 19 Feb 2016 14:19:52 -0800 Subject: [python-win32] Problem: methods defined in type library's base class are not accessible in inherited class objects of the type library In-Reply-To: <56C65585.6070401@yahoo.com> References: <56C65585.6070401@yahoo.com> Message-ID: <56C79508.1020608@probo.com> Indranil Sinharoy via python-win32 wrote: > > I am a relatively new user of pywin32 package, but not Python. I have > an application (written in C/#, as I understand) that provides a COM > interface for using with other languages such as Python. I am using > the pywin32 library to communicate with the application and it works > fairly well. However, I am facing a particular kind of problem. The > problem is that the application exposes some interface objects that > inherit from other base objects but the methods defined in the base > class objects doesn't seem to be accessible to the child class object. > Is this type of behavior is atypical with pywin32? I'm wondering about your terminology, and I may have misunderstood your situation. If you are given a COM interface, you can access the methods of that interface, or you can query for another COM interface from the same object. You certainly cannot access the non-COM methods of the underlying object. There is simply no generic way to find those methods, because they are implemented differently in different languages. That's why COM was invented -- it is language-independent. Also remember that, even though YOU know there is an object underneath, that's secret knowledge. All you are supposed to know about is a COM interface -- a set of functions. You can't rely on anything else, and you aren't supposed to know about parent/child relationships. Now, if you are talking about asking an interface to return you another interface from the same object, then the CastTo method you are using is exactly right: > class MyBaseClass: > ... > ... > def my_parent_method(self): > base = win32com.client.CastTo(self, 'MyParentClass') > return base.my_parent_method() > ... That's a fairly efficient operation. It just calls QueryInterface. > Although this strategy works, I would like to find out if there is a > more efficient/ automatic way of resolving this issue. In my > particular case, there are a large number of such objects (that > inherit from some base class without access to the methods defined in > the parent class) provided by the application and I would like to > avoid re-writing all the methods for all such objects. To a certain extent, this represents a design flaw in the objects you are invoking. When you have a lot of COM interfaces, each with a few methods, you end up doing an awful lot of QueryInterface calls. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From vernondcole at gmail.com Sat Feb 20 17:26:04 2016 From: vernondcole at gmail.com (Vernon D. Cole) Date: Sat, 20 Feb 2016 22:26:04 +0000 Subject: [python-win32] pywin32 build 220 adodbapi loads incorrectly on Python3. Message-ID: The error I made in the manifest files for adodbapi in the former release has been corrected, so adodbapi now installs correctly in Python 2. However, the conversion to Python 3 is in error. I shall track down that foul-up in due course. After installing build 220 on Python3, you will need to separately install adodbapi -- on my test bed, this worked:... py -3 -m pip install adodbapi From laurent.solano at gmail.com Mon Feb 22 03:46:11 2016 From: laurent.solano at gmail.com (laurent solano) Date: Mon, 22 Feb 2016 09:46:11 +0100 Subject: [python-win32] equivalent selenium findElement(By.xpath...) with win32com Message-ID: Hi, I'm automating ie webbrowser with win32com module. I need to locate some xpath elements to manipulate them. Is there a way to do it ? More or less, i need the same feature than findElement(By.xpath ...) from selenium. Can anyone help ? thanks in advance, Laurent, -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.callan at infoshare-is.com Mon Feb 22 05:23:52 2016 From: simon.callan at infoshare-is.com (Simon Callan) Date: Mon, 22 Feb 2016 10:23:52 +0000 Subject: [python-win32] program with embedded python fails to start witn python 2.7.11 amd64 Message-ID: Hi, I have a windows program that has python embedded in for scripting programs. If I install Python 2.7.10 64 bit (python-2.7.10.amd64.msi), and run the program, it works fine. If I install Python 2.7.11 64bit (python-2.7.11.amd64.msi), and run the program, fails with the error "missing module site". However, if I run the program from a batch file, and add "set PYTHONPATH=C:\python27\lib", the program starts up and runs normally. The only difference is the version of python installed, and we are running on Windows Server 2008 R2 Standard, SP1 with 3GB RAM, and a quad core processor. Is it possible that the python 2.7.11 install is not setting a required registry entry, or that my program is doing something wrong? Simon ________________________________ Infoshare is registered in England and Wales. Registered Office: Infoshare Ltd, Millennium House, 21 Eden Street, Kingston upon Thames, KT1 1BL | Registered Number: 2877612 | VAT Number: GB 678 1443 10 The content of this e-mail (and any attachment to it) is confidential. Any views or opinions do not represent the views or opinions of Infoshare Ltd. If you have received this e-mail in error please notify the sender and delete it. You may not use, copy or disclose the information in any way. Infoshare Ltd monitors incoming and outgoing e-mails. Please consider the environment. Do you really need to print this email? -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Mon Feb 22 16:14:05 2016 From: timr at probo.com (Tim Roberts) Date: Mon, 22 Feb 2016 13:14:05 -0800 Subject: [python-win32] equivalent selenium findElement(By.xpath...) with win32com In-Reply-To: References: Message-ID: <56CB7A1D.5010900@probo.com> laurent solano wrote: > > I'm automating ie webbrowser with win32com module. > > I need to locate some xpath elements to manipulate them. Is there a > way to do it ? > More or less, i need the same feature than findElement(By.xpath ...) > from selenium. Why don't you show us the code you have? The Internet Explorer COM object surface is very large, so we don't want to waste time explaining what you already know. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From KiranKumarJakkampudi at Eaton.com Mon Feb 22 23:14:10 2016 From: KiranKumarJakkampudi at Eaton.com (KiranKumarJakkampudi at Eaton.com) Date: Tue, 23 Feb 2016 04:14:10 +0000 Subject: [python-win32] FW: pywintypes Error Message-ID: <17FDE7AA545E5543B57F5C8F7EABEAAC134A4A6F@SIMTCSMB12.napa.ad.etn.com> Hi , I am getting an error mentioned below while using in some of the machines when trying to open the application where as it is working fine in some of the machines : I also tried to create the Class id manually using the reg-edit but it didn't worked. I am using win-7 32 bit OS , python 2.4.4,Pmw module and pywin ,pyinstaller,pythoncom..etc Can you suggest how to force the class Id in to valid string either through code or manually by dll registration? Can anyone please help me to figure it out? [cid:image003.jpg at 01D168C2.27C374C0] Thanks! Kiran -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image003.jpg Type: image/jpeg Size: 41706 bytes Desc: image003.jpg URL: From sfauveau at apli-agipa.com Tue Feb 23 08:53:34 2016 From: sfauveau at apli-agipa.com (Sylvain Fauveau) Date: Tue, 23 Feb 2016 14:53:34 +0100 Subject: [python-win32] Error in word with AddTextbox Message-ID: Hi. ? I'm trying to add a textbox in word with python 2.7 / pywin 220 Under Windows Server 2008. ? from win32com.client import Dispatch, constants word = Dispatch('Word.Application') document = word.Documents.Add() orientation = constants.wdTextOrientationHorizontal left = 100 top = 100 width = 200 height=100 document.Shapes.AddTextbox(orientation, left, top, width, height) This give me this error: Traceback (most recent call last): ? File "add_textbox.py", line 10, in ??? document.Shapes.AddTextbox(orientation, left, top, width, height) ? File "c:\usr\python27\lib\site-packages\win32com\gen_py\00020905-0000-0000-C000-000000000046x0x8x5.py", line 21712, in AddTextbox ??? , Left, Top, Width, Height, Anchor pywintypes.com_error: (-2147352567, 'Une exception s'est produite.', (0, None, u'La valeur tapee est en dehors des limites.', None, 0, -2147024809), None) (A value typed is off limits) I have absolutely no idea why this example doesn't work. All the args of the AddTextbox method are not optionnal. If someone had an idea... Thanks in advance From timr at probo.com Tue Feb 23 12:34:05 2016 From: timr at probo.com (Tim Roberts) Date: Tue, 23 Feb 2016 09:34:05 -0800 Subject: [python-win32] FW: pywintypes Error In-Reply-To: <17FDE7AA545E5543B57F5C8F7EABEAAC134A4A6F@SIMTCSMB12.napa.ad.etn.com> References: <17FDE7AA545E5543B57F5C8F7EABEAAC134A4A6F@SIMTCSMB12.napa.ad.etn.com> Message-ID: <56CC980D.7090903@probo.com> KiranKumarJakkampudi at Eaton.com wrote: > > > I am getting an error mentioned below while using in some of the > machines when trying to open the application where as it is working > fine in some of the machines : > > > > I also tried to create the Class id manually using the reg-edit but it > didn?t worked. > > I am using win-7 32 bit OS , python 2.4.4,Pmw module and pywin > ,pyinstaller,pythoncom..etc > > Can you suggest how to force the class Id in to valid string either > through code or manually by dll registration? > > Can anyone please help me to figure it out? > You posted this question a week ago, and I responded. Did you not like the answer? "Invalid class string" means the server DLL is not registered. You need to use "regsvr32" to register the DLL. It's just that simple. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From timr at probo.com Tue Feb 23 12:43:58 2016 From: timr at probo.com (Tim Roberts) Date: Tue, 23 Feb 2016 09:43:58 -0800 Subject: [python-win32] Error in word with AddTextbox In-Reply-To: References: Message-ID: <56CC9A5E.8010501@probo.com> Sylvain Fauveau wrote: > I'm trying to add a textbox in word with python 2.7 / pywin 220 Under Windows Server 2008. > > from win32com.client import Dispatch, constants > word = Dispatch('Word.Application') > document = word.Documents.Add() > orientation = constants.wdTextOrientationHorizontal > left = 100 > top = 100 > width = 200 > height=100 > document.Shapes.AddTextbox(orientation, left, top, width, height) The documentation for AddTextBox would have explained this. You need to use msoTextOrientationHorizontal, not wdTextOrientationHorizontal. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc.