Click here to Skip to main content
15,896,912 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to call unmanaged C++ DLL in C#.NET Pin
suzalinda3-Dec-09 12:50
suzalinda3-Dec-09 12:50 
QuestionWindows Form updating problem Pin
MathewPV10-Nov-09 19:06
MathewPV10-Nov-09 19:06 
AnswerRe: Windows Form updating problem Pin
Christian Graus10-Nov-09 19:35
protectorChristian Graus10-Nov-09 19:35 
QuestionListView annoying Pin
Xmen Real 10-Nov-09 19:00
professional Xmen Real 10-Nov-09 19:00 
QuestionOpening file with in its application Pin
Hum Dum10-Nov-09 18:21
Hum Dum10-Nov-09 18:21 
AnswerRe: Opening file with in its application Pin
Christian Graus10-Nov-09 18:32
protectorChristian Graus10-Nov-09 18:32 
GeneralRe: Opening file with in its application Pin
Hum Dum10-Nov-09 20:25
Hum Dum10-Nov-09 20:25 
AnswerRe: Opening file with in its application Pin
dan!sh 10-Nov-09 19:00
professional dan!sh 10-Nov-09 19:00 
GeneralRe: Opening file with in its application Pin
Hum Dum10-Nov-09 20:26
Hum Dum10-Nov-09 20:26 
AnswerRe: Opening file with in its application Pin
Luc Pattyn11-Nov-09 1:31
sitebuilderLuc Pattyn11-Nov-09 1:31 
GeneralRe: Opening file with in its application Pin
hollismarek11-Nov-09 11:00
hollismarek11-Nov-09 11:00 
GeneralRe: Opening file with in its application Pin
Hum Dum11-Nov-09 20:20
Hum Dum11-Nov-09 20:20 
GeneralRe: Opening file with in its application Pin
hollismarek12-Nov-09 2:34
hollismarek12-Nov-09 2:34 
GeneralRe: Opening file with in its application Pin
Hum Dum11-Nov-09 20:17
Hum Dum11-Nov-09 20:17 
QuestionProblem with BCP in C# Pin
sudhirBirlapur10-Nov-09 18:02
sudhirBirlapur10-Nov-09 18:02 
AnswerRe: Problem with BCP in C# Pin
Christian Graus10-Nov-09 18:17
protectorChristian Graus10-Nov-09 18:17 
QuestionList element copying problem Pin
Charlesh310-Nov-09 15:35
Charlesh310-Nov-09 15:35 
A few months ago some of you helped this hardware engineer with a c background understand that list elements are passed by reference. I solved my immediate problem but have run into another wall.

I have two global lists defined in my form:

            List <CUserMem> MemoryBank = new List<CUserMem>(100);
            List <CUserMem> CombinedMemories = new List<CUserMem>(100);

After a while, the first list becomes has out of date info and I must "garbage collect" by copying the still-needed elements of the first list to the second list. I simply do :

            CombinedMemories[Index].whateverelement = MemoryBank[AnotherIndex].whateverelement;

It works the first time through but of course the next time I update MemoryBank, CombinedMemories is also updated. I tried to avoid this by:

            local (temporary) variable = MemoryBank[AnotherIndex].whateverelement;
            CombinedMemories[Index].whateverelement = local (temporary) variable;

That doesn't work. After the local variable is destroyed, the two list elements still have the same reference.

So what is the correct way to work with 2 global lists like this?? Can I create a copy of the first list that is not "linked" (have the same reference)???


Thanks -

Chuck


Chuck
AnswerRe: List element copying problem Pin
Luc Pattyn10-Nov-09 15:41
sitebuilderLuc Pattyn10-Nov-09 15:41 
AnswerRe: List element copying problem Pin
Gerry Schmitz10-Nov-09 17:32
mveGerry Schmitz10-Nov-09 17:32 
GeneralRe: List element copying problem Pin
Charlesh311-Nov-09 8:09
Charlesh311-Nov-09 8:09 
GeneralRe: List element copying problem [modified] Pin
Gerry Schmitz11-Nov-09 11:38
mveGerry Schmitz11-Nov-09 11:38 
GeneralRe: List element copying problem Pin
Charlesh315-Nov-09 9:17
Charlesh315-Nov-09 9:17 
GeneralRe: List element copying problem Pin
Gerry Schmitz15-Nov-09 12:36
mveGerry Schmitz15-Nov-09 12:36 
QuestionUnable to refresh dataset in (rdlc) report Pin
Crapaw4510-Nov-09 10:07
Crapaw4510-Nov-09 10:07 
AnswerRe: Unable to refresh dataset in (rdlc) report Pin
Abhishek Sur10-Nov-09 11:09
professionalAbhishek Sur10-Nov-09 11:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.