Click here to Skip to main content
15,888,141 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi,
I have a project which references few com objects in a list (for each). I need to copy one object within the loop and compare it with the second one in iteration.
I'm not sure how to copy a com object by value. Please help.
Thanks.
Posted

1 solution

Most likely, by "copy by value", you mean cloning. Please see: https://msdn.microsoft.com/en-us/library/system.object.memberwiseclone%28v=vs.110%29.aspx[^] (COM objects, ones they are used in .NET, are no different).

On this page, see also the comments on deep cloning.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900