[python-win32] Shellfolder.ParseDisplayName problem

Mark Hammond mhammond at skippinet.com.au
Wed Feb 2 13:03:13 CET 2005


As indicated in the docs, ParseDisplayName takes 3 params - hwnd,
bindContext, displayName.  You are passing None for the hwnd, which is
invalid.  You probably want to pass (0, None, r"e:\...")

Also documented, the return value is a tuple of (cchEaten, pidl, attr) - see
the MS docs for this interface for details on what these actually are.  Note
that none are a "handle" to the file - the only useful thing coming back is
a PIDL, which is only useful when passed back to other shell functions.

Mark.

> -----Original Message-----
> From: python-win32-bounces at python.org
> [mailto:python-win32-bounces at python.org]On Behalf Of Guy Robinson
> Sent: Wednesday, 2 February 2005 9:18 PM
> To: python-win32 at python.org
> Subject: [python-win32] Shellfolder.ParseDisplayName problem
>
>
> Hello,
>
> I'm trying to get a handle to a file using parseDisplayName:
>
> sh = pythoncom.CoCreateInstance(shell.CLSID_ShellFSFolder,
>                                  None,
>                                  pythoncom.CLSCTX_INPROC_SERVER,
>                                  shell.IID_IShellFolder)
>
> objtup = sh.ParseDisplayName(None,1,"E:\extractimage\sheet.txt")
>
> But I get an error:
>
> ""TypeError: an integer is required""
>
> which I assume relates to the pbcReserved parameter. It wants
> a PyIBindCtx
> according to the documentation.
>
> How do I create the correct value for this?
>
> Any help appreciated.
>
> Regard,
>
> Guy
>
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32



More information about the Python-win32 mailing list