[python-win32] python and COM - in particular Visual SourceSafe

Graham Bloice graham.bloice at trihedral.com
Mon May 12 11:32:20 EDT 2003


> does work fine after generating this file like the MS-IDE.
> The expected method I need will be listed in this way:
>
> # Result is of type IVSSItem
> # The method GetVersion is actually a property, but must be used
> as a method to
> correctly pass the arguments
> def GetVersion(self, Version=defaultNamedOptArg):
>     ret = self._oleobj_.InvokeTypes(0x18, LCID, 2, (9, 0),
> ((12,17),),Version)
>     if ret is not None: ret = win32com.client.Dispatch
> (ret, 'GetVersion', '{2A0DE0E7-2E9F-11D0-9236-00AA00A1EB95}',
> UnicodeToString=0)
>     return ret
>
> (The mail-program will give the sequence maybe a wrong format)
>
> Considere that oVSSItem is a object of type IVSSItem. I can get any
> version of this item like this:
>
> ThisVersion = oVSSItem.GetVersion(<SomeLabel>)
>
> The problem I have is, that the method GetVersion will not appear in the
> object catalog of VB.
>
> Why I can see .GetVersion in the makepy-file ?
>

Using OLE Viewer to view the type library for SourceSafe, shows that the
IVSSItem interface has a property, Version(), that takes an argument.  To
allow Python to pass the argument, MakePy converts the property into a
method, as indicated by the comments in the MakePy generated file.  As this
is a property get, the "Get" is prepended to the property name.

So in VB, just look for .Version.

Graham Bloice





More information about the Python-win32 mailing list