[pywin32-bugs] [ pywin32-Bugs-1920299 ] arrayOfVariantOfBSTR in Python
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2012-01-28 05:17:48
|
Bugs item #1920299, was opened at 2008-03-19 15:45 Message generated for change (Comment added) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1920299&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Out of Date Priority: 5 Private: No Submitted By: Mustafa (goermezer) Assigned to: Nobody/Anonymous (nobody) Summary: arrayOfVariantOfBSTR in Python Initial Comment: Hi, I have problem with an application which I try to automate with win32com. My problem is now, that a GetListOfDependantFile expects a arrayOfVariantOfBSTR byreference. I think this must be a list of strings. The VB Code is this: Set Send1 = CATIA.CreateSendTo() Call Send.SetInitialFile(myfile) ReDim arrayOfVariantOfBSTR(500) Call Send1.GetListOfDependantFile(arrayOfVariantOfBSTR) How can I write this in Python for win32com ? best regards Mustafa Görmezer ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2012-01-27 21:17 Message: It isn't clear this is still a problem - and the new builtin VARIANT support should make things easier. ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2008-05-05 06:16 Message: Logged In: YES user_id=14198 Originator: NO Just noting this is also being discussed in http://www.mail-archive.com/com...@li.../msg00144.html ---------------------------------------------------------------------- Comment By: Mustafa (goermezer) Date: 2008-03-24 06:58 Message: Logged In: YES user_id=1525528 Originator: YES Hi marc, this is my code: import win32com.client app=win32com.client.Dispatch('Catia.Application') sendto=app.CreateSendTo() sendto.SetInitialFile('c:\\...igteil.CATPart') refs=sendto.GetListOfDependantFile() print refs When I use no params I get a type error or type conflict (with makepy): Traceback (most recent call last): File "C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\Dokumente und Einstellungen\mgo\Desktop\px1.py", line 9, in <module> refs=sendto.GetListOfDependantFile() File "C:\DOKUME~1\mgo\LOKALE~1\Temp\gen_py\2.5\14F197B2-0771-11D1-A5B1-00A0C9575177x0x0x0\SendToService.py", line 49, in GetListOfDependantFile return self._ApplyTypes_(1610940417, 1, (24, 0), ((8204, 3),), 'GetListOfDependantFile', None,oDependant File "C:\Python25\Lib\site-packages\win32com\client\__init__.py", line 448, in _ApplyTypes_ dispid, 0, wFlags, retType, argTypes, *args), com_error: (-2147352571, 'Typkonflikt.', None, 1) When I give a list as the param, the function returns the param as a tuple: GetListOfDependantFile([]) returns () GetListOfDependantFile(['hello']) returns (u'hello',) Here is the traceback without makepy: Traceback (most recent call last): File "C:\Dokumente und Einstellungen\mgo\Desktop\px1.py", line 6, in <module> refs=sendto.GetListOfDependantFile() File "<COMObject CreateSendTo>", line 2, in GetListOfDependantFile File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 258, in _ApplyTypes_ result = self._oleobj_.InvokeTypes(*(dispid, LCID, wFlags, retType, argTypes ) + args) pywintypes.com_error: (-2147352567, 'Ausnahmefehler aufgetreten.', (0, 'CATIASen dToService', 'Das Verfahren GetListOfDependantFile ist fehlgeschlagen', None, 0, -2147024809), None) ---------------------------------------------------------------------- Comment By: Mark Hammond (mhammond) Date: 2008-03-24 00:49 Message: Logged In: YES user_id=14198 Originator: NO If you run makepy, you should be able to pass no params - the strings will be returned. Please show the code you use and the exception you see. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1920299&group_id=78018 |