473,321 Members | 1,667 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Copying objects that support ICloneable interface

Hello:

I have an object Users that implements the ICloneable
interface.

I am trying to pass an instance of this object, foUser
from one form into a second form ByRef.

Dim formLogin As New frmLogin(foUser)

The second form creates a local instance of this object.
When all the business rules are obeyed, I have the
following statement that copies this local copy to the
instance that was passed in Byref:

foUser = CType(loUser, Users.Users).Clone

But when the control gets passed to the first form, it
looses all the values.

Any ideas on what I may be doing wrong?

Thanks.

Venkat

Nov 20 '05 #1
2 2217
"Venkat Venkataramanan" <th****@hotmail.com> schrieb
Hello:

I have an object Users that implements the ICloneable
interface.

I am trying to pass an instance of this object, foUser
from one form into a second form ByRef.

Dim formLogin As New frmLogin(foUser)

The second form creates a local instance of this object.
When all the business rules are obeyed, I have the
following statement that copies this local copy to the
instance that was passed in Byref:

foUser = CType(loUser, Users.Users).Clone

But when the control gets passed to the first form, it
looses all the values.

Any ideas on what I may be doing wrong?


What does the constructor of frmLogin look like? Where and how did you
declare foUser? How do you pass the new object to the calling form?
--
Armin

Nov 20 '05 #2

Hi Venkat,

Can you show me how do you implement the Clone method of
ICloneable interface?

After the statement foUser = CType(loUser, Users.Users).Clone, does your
foUser get all the value of the loUser object?(Before returing to the first
form)

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| Content-Class: urn:content-classes:message
| From: "Venkat Venkataramanan" <th****@hotmail.com>
| Sender: "Venkat Venkataramanan" <th****@hotmail.com>
| Subject: Copying objects that support ICloneable interface
| Date: Mon, 15 Sep 2003 06:18:55 -0700
| Lines: 26
| Message-ID: <08****************************@phx.gbl>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="iso-8859-1"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
| Thread-Index: AcN7i+nh0exZISijRq2WI1YOzo8jqA==
| Newsgroups: microsoft.public.dotnet.languages.vb
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.languages.vb:137010
| NNTP-Posting-Host: tk2msftngxa12.phx.gbl 10.40.1.164
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Hello:
|
| I have an object Users that implements the ICloneable
| interface.
|
| I am trying to pass an instance of this object, foUser
| from one form into a second form ByRef.
|
| Dim formLogin As New frmLogin(foUser)
|
| The second form creates a local instance of this object.
| When all the business rules are obeyed, I have the
| following statement that copies this local copy to the
| instance that was passed in Byref:
|
| foUser = CType(loUser, Users.Users).Clone
|
| But when the control gets passed to the first form, it
| looses all the values.
|
| Any ideas on what I may be doing wrong?
|
| Thanks.
|
| Venkat
|
|

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robert Tarantino | last post by:
Hello, I am trying to find a way to create a scheduled task or service that will copy my local profile folders under "Documents and settings" to a network drive. This would allow me to restore...
10
by: Jax | last post by:
I dont seem to fully comprehend references to objects yet. Lets say for example I do this; Customer c = new Customer(); Customer c1 = c; I understand that if I change c1, I also change c as...
5
by: Steve - DND | last post by:
Is there any way to easily deep copy an entire object? Maybe something with unsafe code to make a full and completely duplicated copy of an object with no reference ties to the original? I want...
6
by: Andy | last post by:
Hello. I've got an issue with the ICloneable interface that makes me think I'm missing the advantages of it. My issue is that the implemented Clone method returns an object and not a strongly...
5
by: Bob Weiner | last post by:
This seems real simple but I don't know how to do it. Obviously, what I'm looking for isn't what I typed. I don't want the assignment operator in commit() and reset() to work by reference but...
7
by: Don | last post by:
Can anyone give me an example of implementing ICloneable to give a class I created a "Clone" method so I can make copies of objects. I have no idea where to begin with this. Thanks. - Don
1
by: Rain | last post by:
Hi. Im a C# newbie, just want to ask how to implement the ICloneable.Clone.. Dont know how it works, would really appreciate it if someone could show a simple source sample of how to do this.....
4
by: jjkboswell | last post by:
I have an XSD which I have generated a class from using the xsd.exe tool. My XSD contains complex types within it, so that the generated class has member variables which are of types that are also...
2
by: Nathan | last post by:
I'm working with Clone() for the first time, and noticed that you have to unbox the Clone of an object that implements ICloneable: MyObject var1 = new MyObject(); // Where MyObject implements...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.