How to Passs NULL as a IDispatch Pointer to method?

ZhaoYingpu at gmail.com ZhaoYingpu at gmail.com
Tue Apr 17 00:24:30 EDT 2007


Hello,all
  I am using win32com to use com. and invoke a method as follows:
void AddShapeInfo(LPCTSTR name, LONG type, IDispatch* pDisp);
but i pass 0 or None to third parameter and get error info:

>>> x.AddShapeInfo("who", 10, 0)

Traceback (most recent call last):
  File "<pyshell#9>", line 1, in <module>
    x.AddShapeInfo("who", 10, 0)
  File "<COMObject xxx.Document>", line 2, in AddShapeInfo
com_error: (-2147352571, 'Type mismatch.', None, 3)

or

>>> x.AddShapeInfo("who",0,None)

Traceback (most recent call last):
  File "<pyshell#15>", line 1, in <module>
    x.AddShapeInfo("who",0,None)
  File "<COMObject xxx.Document>", line 2, in AddShapeInfo
com_error: (-2147352571, 'Type mismatch.', None, 3)




More information about the Python-list mailing list