The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by fractal97]

I tried to use python COM example on page 250 but without success.

In a file PythonComExample.py I stored the code from page 250

I run it first like this ...

C:quickpython>python PythonComExample.py
Registered: PythonComExample.DemoServer

and then ...

C:quickpython>python PythonComExample.py /test
doing direct tests...
passed direct test
testing COM
**** - The PythonComExample.DemoServer is not available

Why is that object not available?

The object appears in the COM object viewer, but I can't get it with
ds = win32com.client.dynamic.Dispatch("PythonComExample.DemoServer")
import-bot (20211) [Avatar] Offline
#2
Re: problem with running COM example
[Originally posted by daryl d harms]

Hi Vin,

I see the same problem. I've passed the problem on to my "expert" on this
chapter and am waiting a response from him.

Daryl
import-bot (20211) [Avatar] Offline
#3
Re: problem with running COM example
[Originally posted by johngalt47]

I have a similar problem except mine occurs when trying to create the
PythonComExample object.

The VB error message leads me to believe that it can't find ar_com_servers.py.
When I looked for that file on my hard drive, sure enough it isn't there. I
downloaded and ran win32all.exe. I'm using NT4, service pack 5.

Ren

> Hi Vin,
>
> I see the same problem. I've passed the problem on to my "expert" on this
> chapter and am waiting a response from him.
>
> Daryl
import-bot (20211) [Avatar] Offline
#4
Re: problem with running COM example
[Originally posted by bapeterson]

I note this thread was started in February 2002 -- anyone had any luck in
getting the com example in section 22.4.7 to work? I see the same problem --
PythonDemoCom says its registered but can't find it during the test routine.




> I have a similar problem except mine occurs when trying to create the
> PythonComExample object.
>
> The VB error message leads me to believe that it can't find ar_com_servers.py.
> When I looked for that file on my hard drive, sure enough it isn't there. I
> downloaded and ran win32all.exe. I'm using NT4, service pack 5.
>
> Ren
>
> > Hi Vin,
> >
> > I see the same problem. I've passed the problem on to my "expert" on this
> > chapter and am waiting a response from him.
> >
> > Daryl
import-bot (20211) [Avatar] Offline
#5
Solution to problem with running COM example
[Originally posted by bapeterson]

The problem is the following statement should be omitted

#_reg_class_spec_ = "ar_com_servers.DemoServer

Once this is commented out the code works fine.
import-bot (20211) [Avatar] Offline
#6
Solution to problem with running COM example
[Originally posted by d. harms]

> The problem is the following statement should be omitted
>
> #_reg_class_spec_ = "ar_com_servers.DemoServer
>
> Once this is commented out the code works fine.

Thanks, Bruce very much for coming up with this solution.

Daryl