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: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Guy Robinson
> Sent: Wednesday, 2 February 2005 9:18 PM
> To: [email protected]
> 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
> [email protected]
> http://mail.python.org/mailman/listinfo/python-win32

_______________________________________________
Python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to