Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parameter passing in COM/DCOM

Status
Not open for further replies.

bilshah

IS-IT--Management
Feb 22, 2001
4
HK
Hello,
I work in Microsoft tools. I am Visual Basic programmer and I use SQL server as backend database. Currently I am working in COM/DCOM technology. I have a confusion about object/variable parameter passing. I want you to please provide me a detailed awnser.
Here is the problem:-
When we pass a variable/object by val in Visual Basic then that variable's value is passed to function or procedure and when we pass a variable/object by ref then its memory address is passed rather than value itself. The procedure or function make changes directly to that address space.
What happens when we pass a reference of variable/object to a component (.dll or .exe) placed on other machine? Does that machine actually make changes directly to the address of that variable/object on client machine or what?
I couldn't figure out what happens behind the scenes. Please do me a favour in this regard. I would be highly obliged at early prompt.
Thanx
 
The marshaller will take care of the referencing and dereferencing. The server will not have access to the address space of the client. The value in client's pointer will be sent to the server. Hope this helps.

There's lots of literature available for the same on the net.
 
This is not true for complex variable types such as objects. You can pass basic variable types such as strings, integers,etc., but objects do not marshal well even when passed ByVal. This is because the Marshaller does not know how to Marshal custom objects . . . you need to serialize the state data of your objects and then pass that data . . . this can be done with XML or a simple byte stream. - Jeff Marler
(please note, that the page is under construction)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top