On Wed, Nov 5, 2008 at 1:19 PM, Thomas Heller <[EMAIL PROTECTED]> wrote:
>
> Does the solution that Martin posted not work for you?

I am developing on a Windows XP machine, but test the py2exe-packed
binaries also on Windows 2000 and Windows 98 virtual machines.
Martins example

import comtypes, sys
from comtypes.client import CreateObject
ws = CreateObject("WScript.Shell")
from comtypes.gen import IWshRuntimeLibrary
shortcut = 
ws.CreateShortcut("test_shortcut.lnk").QueryInterface(IWshRuntimeLibrary.IWshShortcut)
shortcut.TargetPath = sys.executable
shortcut.Save()

works fine on my Windows XP machine and the Windows 2000 virtual
machine, but fails on the Windows 98 virtual machine with the error
log file

Traceback (most recent call last):
  File "test.py", line 5, in <module>
AttributeError: 'POINTER(IUnknown)' object has no attribute 'CreateShortcut'

Maybe the version of the Windows Script Host installed there is too
old to contain the CreateShortcut functionality.  Therefore I would
prefer not to depend on the Windows Script Host.

When building a py2exe-binary of the pywin32 code of my first post in
this thread, it runs fine even on this Windows 98 virtual machine.

Kind regards,
Markus

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to