win32com.client.pythoncom.CoCreateInstance

Roger Upole rupole at compaq.net
Wed Aug 2 19:26:40 EDT 2000


This code works on my win98 machine.
However, there is an easier way to do this.  There is a shell
module in the win32comext directory..  For an example of how
to use it, see \win32com\win32com.hlp.
             hth
             Roger Upole

<musingattheruins at my-deja.com> wrote in message
news:8m9hrr$fi$1 at nnrp1.deja.com...
> does anyone have any idea why this does not work?  i am trying to get a
> handle to the IShellLinkA interface that will allow me to create
> shortcuts but the COM code seems to have a problem.
>
> any help would be greatly appreciated!
>
> import win32com.client, pywintypes
> #win32com.client.pythoncom.CoInitialize()
> CLSID_ShellLink = pywintypes.IID("{00021401-0000-0000-C000-
> 000000000046}")
> iShellLink      = pywintypes.IID("{000214EE-0000-0000-C000-
> 000000000046}")
> create_as = win32com.client.pythoncom.CLSCTX_INPROC_SERVER
> i = win32com.client.pythoncom.CoCreateInstance(CLSID_ShellLink, None,
> create_as, iShellLink)
>
> here is the error that it returns...
>
> Traceback (innermost last):
>   File "<stdin>", line 1, in ?
> TypeError: There is no interface object registered that supports this
> IID
>
> the registry lists both of these guids and the shell32.dll exists; i
> can create shortcuts manually.
>
> thanks.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.





More information about the Python-list mailing list