S
serge calderara
Dear all,
I have really strange behviour when passing an object to a
function by value:
if I create a new object of myClass from the main
application as follow:
myObj = new (ObjSource)
then the instance is creted on a separate assambly an
reach the code of the constructor of myClass
public sub new (byval obj as object)
.....
....
' here I try to channge some object value
obj.name ="test"
end sub
At this time when the object is created and I return to
the calling point in my main application , the object is
also modifed in the main application, and it should be not
as it is pass by value to the constructo of myClass !!
What did I miss here?
thnaks for your information
regards
Serge
I have really strange behviour when passing an object to a
function by value:
if I create a new object of myClass from the main
application as follow:
myObj = new (ObjSource)
then the instance is creted on a separate assambly an
reach the code of the constructor of myClass
public sub new (byval obj as object)
.....
....
' here I try to channge some object value
obj.name ="test"
end sub
At this time when the object is created and I return to
the calling point in my main application , the object is
also modifed in the main application, and it should be not
as it is pass by value to the constructo of myClass !!
What did I miss here?
thnaks for your information
regards
Serge