On 26 August 2010 02:35, Mark Hammond <skippy.hamm...@gmail.com> wrote:
> ... > import generated_file # the makepy generated file. > lr = win32com.client.Dispatch("wlrun.LrEngine") > lr = generated_file.LrEngine(lr) # wrap it. > ... > The above assumes the class name in the generated file is also LrEngine. > ... > Note that even then, to get reasonable byref behaviour the IDL file for the > object will need to have specified the "in/out" semantics correctly. > > HTH, > > Mark > Thanks for the input Mark. I've got a workaround doing the above and also editing the makepy generated file. The problem seems to be that Get... methods pass the ByRef parameter when it is not needed. Rather than changing everything, I'm just changing methods as and when I need them. For example: # def GetVuserTypeLicenseLimit(self, strVuserType=defaultNamedNotOptArg, pRetLimit=defaultNamedNotOptArg): # """Get the License limit for the Vuser Type """ # return self._oleobj_.InvokeTypes(8, LCID, 1, (3, 0), ((8, 1), (16387, 0)),strVuserType # , pRetLimit) def GetVuserTypeLicenseLimit(self, strVuserType=defaultNamedNotOptArg): """Get the License limit for the Vuser Type """ return self._oleobj_.InvokeTypes(8, LCID, 1, (3, 0), ((8, 1), (16387, 0)),strVuserType )* * Then I can use: import win32com.client import lrcontroller # the makepy generated file, renamed and put in site-packages lr = win32com.client.Dispatch("wlrun.LrEngine") lr = lrcontroller.LrEngine(lr) # wrap it. lr.ShowMainWindow(True) # <- works fine, application pops up ok. status, webVusers = lr.GetVuserTypeLicenseLimit("Web & Multimedia Bundle") # <:-) print webVusers Maybe not the most elegant solution, but it does the job! Mark.
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32