> -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Rex Corrovan > Sent: Wednesday, 10 January 2007 7:54 AM > To: python-win32@python.org > Subject: [python-win32] MemoryError: CreatingSafeArray when trying to > use VBCOM API > > > I have a VB COM App I am trying to use. > > I used makepy and it generated the wrapper. Then I go to use: > > import win32com.client > o = win32.client.Dispatch("vbAPI.App") > > o.myFunct(arg1=("test","test"), arg2=1, arg3=("test2","test2")) > > > The function in the makepy generated wrapper looks like this: > > def myFunct(self, arg1=defaultNamedNotOptArg, > arg2=defaultNamedNotOptArg, > arg3=defaultNamedNotOptArg): > return self._ApplyTypes_(1610809344, 1, (8, 0), ((24584, > 3), (11, 1), > (24612, 3)), 'myFunct', None, arg1, arg2, arg3) > > > The output I get is: > > Traceback (most recent call last): > File "<interactive input>", line 1, in ? > File > "C:\Python24\lib\site-packages\win32com\gen_py\0A54F42C-8CBC-4 > C09-9F6B-C976C6476689x0x1x1.py", > line 43, in myFunct > return self._ApplyTypes_(1610809344, 1, (8, 0), ((24584, > 3), (11, 1), > (24612, 3)), 'myFunct', None, arg1 > File > "C:\Python24\Lib\site-packages\win32com\client\__init__.py", line > 446, in _ApplyTypes_ > return self._get_good_object_( > MemoryError: CreatingSafeArray
This error is raised when the Windows function SafeArrayCreate fails. I'm surprised this is the case - your arrays are very small - but that is the only way this error will be raised. I'm afraid the only advice I can offer is to try and modify the VB test suite to provoke the same error. You will need vb6 and the pywin32 source distro to build the test COM object (in com\TestSources), then use win32com\test\testvb.py to exercise it. That would allow me to reproduce it here. You might also be able to send me the control, and I could at least verify the params we are passing to SafeArrayCreate are sane. Mark _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32