[python-win32] Shellfolder.ParseDisplayName problem

2005-02-02 Thread Guy Robinson
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.Pa

RE: [python-win32] Shellfolder.ParseDisplayName problem

2005-02-02 Thread Mark Hammond
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 interf

[python-win32] python ScriptControl error in Excel while running fine in python

2005-02-02 Thread S�bastien de Menten
I am trying to use ScriptControl under Excel (Windows XP) with the code: Global sc As New MSScriptControl.ScriptControl Public Function os_getcwd() sc.Language = "python" sc.ExecuteStatement ("import os") os_getcwd = sc.Eval("os.getcwd()") End Function When setting the language to python I

Re: [python-win32] Creating a COM singleton

2005-02-02 Thread Jens B. Jorgensen
This is indeed an interesting thing do to. The 'right' way to create a singleton COM object is probably to run an NT Service that hosts the COM object. The COM Service Control Manager decides when to spin up new processes for LocalServer32 server object creation requests. You need a process to

Re: [python-win32] Creating a COM singleton

2005-02-02 Thread Jim McCoy
Argh! Well, it turns out that the real problem was that when creating a mutex for a module-level singleton you should not store a ref to the handle in an instance that might find itself getting popped. Assign to a class variable that will stick. D'oh! I will take a look at setting up the COM ob