Please help here: python <==> COM

mep mep_ at 163.com
Sun Dec 5 03:18:33 EST 2004


Resolved. Thanks anyway


-- 
Best Regards,
Wang Kebo

http://www.huihoo.org/~mep


"mep" <mep_ at 163.com> wrote in message news:31f9qfF3bbot9U1 at individual.net...
> Hi,all
>     I'm scripting flashget (A download management tool,
> http://www.amazesoft.com/) using
> python win32 extension, opening a downloading dialog.
> The following pythong code NOT work:
> ====CODE BEGIN====
>  #!/usr/bin/env python
>  # -*- coding: cp936 -*-
>
>  import win32com.client
>
>  flashget = win32com.client.Dispatch('JetCar.Netscape')
>  params = ('http://test.com/1',
>            'http://test.com/2',
>            'http://test.com/3',
>            'http://test.com/4',
>            'http://test.com/5')
>
>  flashget.AddUrlList(params)
> ====CODE END====
>
> It complaints the following:
>   File "<COMObject JetCar.Netscape>", line 2, in AddUrlList
> pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None,
> None,  0, -2146828283), None)
>
> But the following VBS code does the tricky:
> ====CODE BEGIN====
>  Dim params(4)
>  set flashget=CreateObject("JetCar.Netscape")
>
>  params(0) = "http://test.com/1"
>  params(1) = "http://test.com/2"
>  params(2) = "http://test.com/3"
>  params(3) = "http://test.com/4"
>  params(4) = "http://test.com/5"
>
>  flashget.AddUrlList params
> ====CODE END====
>
> Any hints?
>
> -- 
> Best Regards,
> Wang Kebo
>
> http://www.huihoo.org/~mep
>
>





More information about the Python-list mailing list