|
-
Feb 22nd, 2001, 11:23 AM
#1
Thread Starter
Lively Member
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.
-
Feb 22nd, 2001, 01:39 PM
#2
Addicted Member
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?!
-
Feb 22nd, 2001, 01:44 PM
#3
Thread Starter
Lively Member
Anyone can tell me the picture why pass ByVal doesn't hold the network traffic, but ByRef does?
-
Feb 22nd, 2001, 02:08 PM
#4
Addicted Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|