-
I developed an object and put it into the MTS. For example, ObjName.dll has a class name GetIt(Data). From client side call this object to get the data. Waht's the best way to pass the arguement "Data" by ByVal or ByRef? What's different between those two in term of network traffic? Thanks in advance.
-
when it comes to COM pass it byVal always! it doesn't waste any connections between client and dll since only the value is passed not the reference.
in VB byRef is default way of passing vars
in VB.NET they switch default to be byVal just like in C++
i don't really know why would they default it to byRef?!
anybody?!
-
Anyone can tell me the picture why pass ByVal doesn't hold the network traffic, but ByRef does?
-
i think that byRef holds the reference to that variable
so when you change it has to go back and put the value back to the caller. that's why the connection is active.
byVal is used when only the value of the variable is passed not the reference to that variable thus there is no need to hold the connection over the network.
please correct me if i'm wrong