Hello everybody,
i wonder how the win32 COM extension handles different C-int types
(short, int, long). Another question for me is weather the
"out-direction" of parameter is supported "out of the box" ?
To clarify look at the methode "FunWithTwoInts "
--------------------------------------------------------------------------
#SimpleCOMServe r.py - A sample COM server - almost as small as they come!
#
# We expose a single method in a Python COM object
class PythonUtilities :
_public_methods _ = [ 'FunWithTwoInts ' ]
_reg_progid_ = "PythonDemo.Uti lities"
# NEVER copy the following ID!
# Use "print pythoncom.Creat eGuid( )" to make a new one
_reg_clsid_ = "{40CEA5F8-4D4C-4655-BD8B-0E7B6A26B556}"
def FunWithTwoInts( self, inShort, inInt, outSum):
print "got as short:%d as int:%d sum:%d" % (inShort, inInt, outSum)
outSum = inShort + inInt
# Add code so that when this script is run by
# Python.exe, it self-registers
if __name__=='__ma in_ _':
print "Registerin g COM server..."
import win32com.server .register
win32com.server .register.UseCo mmandLine(Pytho nUtilities)
--------------------------------------------------------------------------
Does anybody have experiences in this ?
Any help/hints are very welcome.
Alexander
i wonder how the win32 COM extension handles different C-int types
(short, int, long). Another question for me is weather the
"out-direction" of parameter is supported "out of the box" ?
To clarify look at the methode "FunWithTwoInts "
--------------------------------------------------------------------------
#SimpleCOMServe r.py - A sample COM server - almost as small as they come!
#
# We expose a single method in a Python COM object
class PythonUtilities :
_public_methods _ = [ 'FunWithTwoInts ' ]
_reg_progid_ = "PythonDemo.Uti lities"
# NEVER copy the following ID!
# Use "print pythoncom.Creat eGuid( )" to make a new one
_reg_clsid_ = "{40CEA5F8-4D4C-4655-BD8B-0E7B6A26B556}"
def FunWithTwoInts( self, inShort, inInt, outSum):
print "got as short:%d as int:%d sum:%d" % (inShort, inInt, outSum)
outSum = inShort + inInt
# Add code so that when this script is run by
# Python.exe, it self-registers
if __name__=='__ma in_ _':
print "Registerin g COM server..."
import win32com.server .register
win32com.server .register.UseCo mmandLine(Pytho nUtilities)
--------------------------------------------------------------------------
Does anybody have experiences in this ?
Any help/hints are very welcome.
Alexander
Comment