Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 104171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:14:22+00:00 2026-05-11T01:14:22+00:00

I have an object not written by myself that I need to clone in

  • 0

I have an object not written by myself that I need to clone in memory. The object is not tagged ICloneable or Serializable so deep cloning through the interface or serialization will not work. Is there anyway to deep clone this object? A non-safe win32 API call maybe?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:14:23+00:00Added an answer on May 11, 2026 at 1:14 am

    FYI Interfaces marked as ICloneable are not necessarily deep copied. It is up to the implementer to implement ICloneable and there is no guarantee they will have cloned it.

    You say the object doesn’t implement ISerializable but does it have the Serializable attribute?

    Creating a deep copy via binary serialization is probably one of the easiest methods I know of, since you can clone any complex graph in 3-5 lines of code. Another option would be the XmlSerializer if the object can be XmlSerialized (You don’t specify any attributes for serialization or implement interfaces however if there is an IDictionary interface your hosed.

    Outside of that I can’t really think of anything. If all the data is publicly accessible you could do your own cloning routine. If its not you can still clone it by using reflection to get set the private data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a program that reads in a File object (really an XML
I have been getting an error in VB .Net object reference not set to
I'm sure we all have received the wonderfully vague Object reference not set to
Is the SqlClient.SqlDataReader a .NET managed object or not? Why do we have to
Not sure what's going on here. I have a DateTime object, and when I
There have been some questions about whether or not JavaScript is an object-oriented language.
I have an object that is mapped to a cookie as a serialized base-64
I have an application written in VB.NET ( NOT asp.net, it is a Windows
I have written a JAXB mapping that stored a sublist inside a root element
I have a basic understanding of mock and fake objects, but I'm not sure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.