COM Error -- Urgent help
Teja
tejovathi.p at gmail.com
Tue Oct 17 03:58:59 EDT 2006
Fredrik Lundh wrote:
> Teja wrote:
>
> > I am sorry. By func(dest) I meant MyNavigate(dest). Can u please help
> > me out...
>
> nobody here can read your mind. please post the code you're actually
> using, *and* the error you're getting.
>
> </F>
Thnks for your immediate reply.
Here is the code:
I have a class GenericFunctions which is defined as
follows:
import win32com.client, pythoncom, thread
ie=win32com.client.Dispatch('internetexplorer.application')
ie.Visible=1
class GenericFunctions:
def __init__(self):
print "In Constructor of Generic Functions"
def MyNavigate(self,dest):
ie.Navigate(dest)
Now there is another file Main.py which is defined as follows:
import win32com.client, pythoncom, thread
from GenericFunctions import *
obj = GenericFunctions()
def threadFunction(self,dest):
pythoncom.CoInitialize()
d=pythoncom.CoGetInterfaceAndReleaseStream(s,
pythoncom.IID_IDispatch)
my_ie=win32com.client.Dispatch(d)
obj.MyNavigate(dest) # this is gving an error.
pythoncom.CoUninitialize()
if __name__ == "__main__":
s=pythoncom.CoMarshalInterThreadInterfaceInStream(pythoncom.IID_IDispatch,ie)
thread.start_new_thread(self.nav, (s,'www.google.com')
I am getting an attribute error
More information about the Python-list
mailing list