Bugs item #1582720, was opened at 2006-10-23 18:02
Message generated for change (Comment added) made by yiwamoto
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582720&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: com
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Matt (matthiaskirst)
Assigned to: Nobody/Anonymous (nobody)
Summary: Python long integers aren't translated to Variant/long
Initial Comment:
Since Version 208 Python long integers are not
translated to Variant/long type anymore.
I think that is on purpose since long integers have
undefined precision.
But isn't it possible to gracefully convert to Variant/
long like in the versions up to 207?
Maybe there is existing code around that can be broken
by the above mentioned behaviour (like my one).
Test code:
import pythoncom
class Test:
_public_methods_ = [ 'Test' ]
_reg_progid_ = "Python.COMTest3"
_reg_clsid_ = "{2D7DD06A-83D3-4F31-848C-
57AFA22A650D}"
_reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER
def Test( self ):
a = long( 0 )
return a
if __name__ == "__main__":
import win32com.server.register
print "Registering..."
win32com.server.register.UseCommandLine( Test )
In VB:
Private Sub Form_Load()
Dim p As Object
Dim a
Set p = CreateObject("Python.COMTest3")
a = p.Test()
End Sub
----------------------------------------------------------------------
Comment By: yiwamoto (yiwamoto)
Date: 2006-12-12 19:59
Message:
Logged In: YES
user_id=1666448
Originator: NO
I supporse this problem occurs under VB(VBA) only.
Since version 208, type conversion(Python type --> COM variant type)
program
uses 'VT_UI4'(unsigned int) COM variant type instead of 'VT_I4'(signed
int).
But, VB(VBA) don't support unsigned int type.
I don't know how to solve this problem.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1582720&group_id=78018
|