Click here to Skip to main content
15,909,896 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
GeneralRe: including pthread.h Pin
try8818-Aug-05 8:08
try8818-Aug-05 8:08 
GeneralRe: including pthread.h Pin
Christian Graus18-Aug-05 17:59
protectorChristian Graus18-Aug-05 17:59 
GeneralRe: including pthread.h Pin
Geilkonijn19-Aug-05 4:23
Geilkonijn19-Aug-05 4:23 
GeneralRe: including pthread.h Pin
S. Senthil Kumar19-Aug-05 8:13
S. Senthil Kumar19-Aug-05 8:13 
QuestionExcel Program in c++? Pin
Anonymous17-Aug-05 16:35
Anonymous17-Aug-05 16:35 
AnswerRe: Excel Program in c++? Pin
Christian Graus17-Aug-05 17:08
protectorChristian Graus17-Aug-05 17:08 
AnswerRe: Excel Program in c++? Pin
Tim Zorn21-Aug-05 5:52
Tim Zorn21-Aug-05 5:52 
GeneralReferenceEquals not behaving logically Pin
ChuckStar17-Aug-05 11:35
ChuckStar17-Aug-05 11:35 
public ref struct PointRef
{
PointRef()
{
runTime = 0;
ampl = 0;
}

PointRef(unsigned long runTime_, unsigned long ampl_)
{
runTime = runTime_;
ampl = ampl_;
}

PointRef(PointRef const % src)
{
runTime = src.runTime;
ampl = src.ampl;
}

unsigned long runTime;
unsigned long ampl;
};

void main()
{
List<PointRef^> errList(numPts);
List<PointRef^> errListCopy(numPts);

for (int idx = 0; idx < numPts; ++idx)
errList.Add(gcnew PointRef(idx, idx));

errListCopy.AddRange(%errList);
if (Object::ReferenceEquals(errList[0], errListCopy[0]))
{
int i = 0; // Never gets here
}

int b = 1; // Set breakpoint here
}

When I get to the breakpoint b=1, I look in the debugger watch window for errList[0] and errListCopy[0]. The addresses for the two are different. When I change the ampl value for either object, the other object changes as well. This acts correctly because the AddRange is copying the references so both lists should be pointing to same objects. My question is why does the ReferenceEquals return false because they refer to the same instance and why do the references have different addresses?

Thanks, Charlie
GeneralRe: ReferenceEquals not behaving logically Pin
Christian Graus17-Aug-05 12:01
protectorChristian Graus17-Aug-05 12:01 
GeneralRe: ReferenceEquals not behaving logically Pin
ChuckStar18-Aug-05 4:03
ChuckStar18-Aug-05 4:03 
GeneralRe: ReferenceEquals not behaving logically Pin
Christian Graus18-Aug-05 14:57
protectorChristian Graus18-Aug-05 14:57 
GeneralRe: ReferenceEquals not behaving logically Pin
Saksida Bojan17-Aug-05 20:26
Saksida Bojan17-Aug-05 20:26 
GeneralRe: ReferenceEquals not behaving logically Pin
ChuckStar18-Aug-05 4:26
ChuckStar18-Aug-05 4:26 
GeneralRe: ReferenceEquals not behaving logically Pin
ChuckStar18-Aug-05 7:38
ChuckStar18-Aug-05 7:38 
GeneralRe: ReferenceEquals not behaving logically Pin
Nish Nishant18-Aug-05 23:55
sitebuilderNish Nishant18-Aug-05 23:55 
GeneralRe: ReferenceEquals not behaving logically Pin
S. Senthil Kumar19-Aug-05 4:21
S. Senthil Kumar19-Aug-05 4:21 
GeneralRe: ReferenceEquals not behaving logically Pin
Nish Nishant19-Aug-05 15:03
sitebuilderNish Nishant19-Aug-05 15:03 
GeneralRe: ReferenceEquals not behaving logically Pin
S. Senthil Kumar19-Aug-05 21:14
S. Senthil Kumar19-Aug-05 21:14 
GeneralRe: ReferenceEquals not behaving logically Pin
S. Senthil Kumar19-Aug-05 7:55
S. Senthil Kumar19-Aug-05 7:55 
GeneralRe: ReferenceEquals not behaving logically Pin
Nish Nishant19-Aug-05 15:04
sitebuilderNish Nishant19-Aug-05 15:04 
QuestionHow to achieve 'True' transparency with pictureBox?? Pin
richiemac17-Aug-05 4:15
richiemac17-Aug-05 4:15 
AnswerRe: How to achieve 'True' transparency with pictureBox?? Pin
Christian Graus17-Aug-05 12:02
protectorChristian Graus17-Aug-05 12:02 
GeneralRe: How to achieve 'True' transparency with pictureBox?? Pin
richiemac18-Aug-05 3:36
richiemac18-Aug-05 3:36 
GeneralRe: How to achieve 'True' transparency with pictureBox?? Pin
Christian Graus18-Aug-05 14:55
protectorChristian Graus18-Aug-05 14:55 
GeneralRe: How to achieve 'True' transparency with pictureBox?? Pin
richiemac18-Aug-05 23:28
richiemac18-Aug-05 23:28 

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.