COM and CreateObject and inheritence

tiddlerdeja at my-deja.com tiddlerdeja at my-deja.com
Sat Jan 22 15:03:14 EST 2000


I managed to get the HelloWorld COM Python example to work using
CreateObject in VB. I could not get a Reference to Python.TestServer so
that I could:

Dim Test and HelloWorld

Instead I had to:

Dim Test As Object

Is it not possible to get a reference to it?

Also, I tried to create my own test:

foo.py
-----

class foo:
    def __init__(self):
        print 'init'

    def bar(self):
        return 99

comfoo.py

from foo import *
class comfoo(foo):
    _reg_clsid_ = "{3F90DE60-D0F5-11D3-96E4-9A059544BB30}"

    _reg_progid_ = "My.Test"

    _reg_desc_ = "COM Test"

    _public_methods_ = ['bar']


    def __init__(self):
        print 'cominit'


When I try to call 'bar' in VB it crashes. comfoo is registered and both
files are in my python path.


Can someone tell me what I'm doing wrong?

Any help appreciated.


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list