[python-win32] Global ActiveScripting object not visible

Vernon D. Cole vernondcole at gmail.com
Tue Apr 15 23:14:21 CEST 2014


One other thing to check: are Python and DO11 this same 32 or 64 bit-ness?
32 bit programs cannot talk to 64 bit COM, and vice-versa.



On Tue, Apr 15, 2014 at 2:49 PM, Łukasz Jakubowski <lukaszj at onet.pl> wrote:

> Hi Vernon,
>
> Thanks for the answer.
>
> The DOpus object is not supposed to be created by a user with Dispatch (as
> DO11 author has told me) - DO11 has no ProgID to use. The object is brought
> into script before passing control to it in the same way as fe. WScript in
> case of .pys, by calling AddNamedItem('DOpus',2) (where 2 =
> SCRIPTITEM_ISVISIBLE), as debugging tells me.
>
> I think the problem lies in one of the two steps from the chapter you
> pointed me to:
>
> """
> 2. Passes the language engine a series of named items. Each named item is
> a COM object (that is, an IDispatch pointer) with a name and attributes.
> The attributes include whether the item is considered global and whether
> the item fires events.
> """
>
> Something is passed improperly? Python has problem with getting IDispatch
> object (the object works OK with JScript or VBasic)?
>
> """
> 3. Each named item is placed in the namespace by the language engine. Any
> named items that fire events have the event-handling mechanism put in
> place. In addition, any object considered global should have all its
> methods and properties made available as global methods and properties.
> """
>
> Object placed incorrectly in the global namespace? Some methods/properties
> not global?
>
> How to check for all the above? Where/how to hook into
> win32com/win32comext?
>
> Regards,
>
>
>  The message means that no one has defined a meaning for the name "DOpus"
>> to
>> Python.
>>
>> You, as a programmer, must define that name.  If you say:
>>
>>> DOpus = "Spam and Eggs"
>>>>>
>>>> then you have defined it as a character string which contains three
>> English
>> words.
>>
>> If you say:
>>
>>> from win32com.client import Dispatch
>>>>> DOpus = Dispatch("Wscript.Network")
>>>>>
>>>> then you will have defined it as a Windows COM dispatch object which
>> will
>> do things (but not the things _you_ are interested in).  You must discover
>> which tool and what name to use to get Directory Opus 11.
>>
>> After you have defined it correctly, then you can use it.
>>
>> You might find the information in chapter
>> 21<http://www.icodeguru.com/WebServer/Python-Programming-
>> on-Win32/ch21.htm>
>>
>>  helpful.
>>
>>
>>
>>
>> On Tue, Apr 15, 2014 at 11:17 AM, Łukasz Jakubowski <lukaszj at onet.pl>
>> wrote:
>>
>>
>>> Hello,
>>>
>>> I have a problem with a file manager called Directory Opus 11. It
>>> supports
>>> ActiveScripting languages, but in case of python, its global objects are
>>> not visible in global namespace.
>>> Python packages (python-3.4.0, pywin32-218.win32-py3.4) seem to be
>>> installed correctly (fe. WScript object is visible in .pys scripts), and
>>> ActiveScripting engine is actually called by Directory Opus.
>>> Where should I start debugging? Are there some possible flags not set or
>>> attributes not presented by the Directory Opus objects that could be
>>> checked? Any namespaces to be searched?
>>>
>>> The exact error message is as follows:
>>> DOpus.OpenOutputWindow()
>>> ^
>>> Traceback (most recent call last):
>>>   File "<Script Block >", line 6, in <module>
>>>     DOpus.OpenOutputWindow()
>>> NameError: name 'DOpus' is not defined
>>>  (0x80020009)
>>>
>>> TIA & Regards,
>>> Łukasz
>>> _______________________________________________
>>> python-win32 mailing list
>>> python-win32 at python.org
>>> https://mail.python.org/mailman/listinfo/python-win32
>>>
>>>
>
> --
> Używam klienta poczty Opera Mail: http://www.opera.com/mail/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20140415/477f7a0c/attachment-0001.html>


More information about the python-win32 mailing list