Update of /cvsroot/pywin32/pywin32/com/win32com/makegw
In directory sc8-pr-cvs1:/tmp/cvs-serv14566
Modified Files:
makegwparse.py
Log Message:
Add TCHAR support.
Index: makegwparse.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/makegw/makegwparse.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** makegwparse.py 6 Oct 2003 13:07:02 -0000 1.9
--- makegwparse.py 8 Oct 2003 04:34:11 -0000 1.10
***************
*** 296,299 ****
--- 296,321 ----
return "\tPy_XDECREF(ob%s);\n" % self.arg.name
+ class ArgFormatterTCHAR(ArgFormatterPythonCOM):
+ def _GetPythonTypeDesc(self):
+ return "string/<o unicode>"
+ def GetUnconstType(self):
+ if self.arg.type[:3]=="LPC":
+ return self.arg.type[:2] + self.arg.type[3:]
+ else:
+ return self.arg.unc_type
+ def GetParsePostCode(self):
+ return "\tif (bPythonIsHappy && !PyWinObject_AsTCHAR(ob%s, %s)) bPythonIsHappy = FALSE;\n" % (self.arg.name, self.GetIndirectedArgName(None, 2))
+ def GetInterfaceArgCleanup(self):
+ return "\tPyWinObject_FreeTCHAR(%s);\n" % self.GetIndirectedArgName(None, 1)
+ def GetBuildForInterfacePreCode(self):
+ # the variable was declared with just its builtin indirection
+ notdirected = self.GetIndirectedArgName(self.builtinIndirection, 1)
+ return "\tob%s = PyWinObject_FromTCHAR(%s);\n" % \
+ (self.arg.name, notdirected)
+ def GetBuildForInterfacePostCode(self):
+ return "// ??? - TCHAR post code\n"
+ def GetBuildForGatewayPostCode(self):
+ return "\tPy_XDECREF(ob%s);\n" % self.arg.name
+
class ArgFormatterIID(ArgFormatterPythonCOM):
def _GetPythonTypeDesc(self):
***************
*** 469,472 ****
--- 491,496 ----
"LPWSTR": (ArgFormatterOLECHAR, 1, 1),
"LPCSTR": (ArgFormatterOLECHAR, 1, 1),
+ "LPTSTR": (ArgFormatterTCHAR, 1, 1),
+ "LPCTSTR": (ArgFormatterTCHAR, 1, 1),
"HANDLE": (ArgFormatterHANDLE, 0),
"BSTR": (ArgFormatterBSTR, 1, 0),
|