Click here to Skip to main content
15,916,463 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Strange problem with CString Pin
rrrado23-Jun-04 5:57
rrrado23-Jun-04 5:57 
GeneralRe: Strange problem with CString Pin
jmkhael23-Jun-04 6:58
jmkhael23-Jun-04 6:58 
GeneralRe: Strange problem with CString Pin
Ravi Bhavnani23-Jun-04 7:06
professionalRavi Bhavnani23-Jun-04 7:06 
GeneralRe: Strange problem with CString Pin
jmkhael23-Jun-04 7:08
jmkhael23-Jun-04 7:08 
GeneralRe: Strange problem with CString Pin
David Crow23-Jun-04 7:11
David Crow23-Jun-04 7:11 
GeneralRe: Strange problem with CString Pin
jmkhael23-Jun-04 7:13
jmkhael23-Jun-04 7:13 
GeneralRe: Strange problem with CString Pin
David Crow23-Jun-04 7:07
David Crow23-Jun-04 7:07 
GeneralRe: Strange problem with CString Pin
rrrado23-Jun-04 20:57
rrrado23-Jun-04 20:57 
Thank you all, guys !

GetAt(0) was typo, it had to be (i) but it's not important.

I'm curious, why my solution did not work. Maybe temporary object
returned from GetAt was destroyed before I called Set().
But anyway, I found GetAt() unusable, since I need to change objects in array,
not some temporary object returned by GetAt().
I don't understand why GetAt is designed to return copy of the object instead of reference/pointer to object in the array,
I had to use this :

for (i=0; i<20; i++)
{
//  (m_array.GetAt(i)).Set();   // setting only temporary object
    m_array[i].Set();  // working
}

AfxMessageBox(m_array.GetAt(0).m_data);


The dialog in GetAt case shows "aaa", in operator[] case returns correct result "hello"
But operator[] is also defined like returning reference, or constant, returning copy, I don't have a clue which type the compiler will choose,
I'm happy that correct type was choosen in my code.
Thanks !


rrrado
GeneralC++ STL help... using pointer in STL map Pin
Indrawati22-Jun-04 23:36
Indrawati22-Jun-04 23:36 
GeneralRe: C++ STL help... using pointer in STL map Pin
Johnny ²23-Jun-04 3:09
Johnny ²23-Jun-04 3:09 
GeneralRe: C++ STL help... using pointer in STL map Pin
Anonymous23-Jun-04 14:20
Anonymous23-Jun-04 14:20 
QuestionHow to Enable/Disable the hibernation support in VC++ Pin
ErisonWu22-Jun-04 21:57
ErisonWu22-Jun-04 21:57 
GeneralChange cursor in a region of a CStatic Pin
doctorpi22-Jun-04 21:52
doctorpi22-Jun-04 21:52 
GeneralRe: Change cursor in a region of a CStatic Pin
Johan Rosengren22-Jun-04 22:21
Johan Rosengren22-Jun-04 22:21 
Questionhow to find all folders which are shared fully in my drive??? Pin
ngocdq22-Jun-04 21:34
ngocdq22-Jun-04 21:34 
AnswerRe: how to find all folders which are shared fully in my drive??? Pin
shri_3120-Sep-04 3:26
shri_3120-Sep-04 3:26 
GeneralCalling a C++ dll in VB with strucures &amp; strings Pin
Cedric Moonen22-Jun-04 21:21
Cedric Moonen22-Jun-04 21:21 
GeneralRe: Calling a C++ dll in VB with strucures & strings Pin
Antony M Kancidrowski22-Jun-04 23:22
Antony M Kancidrowski22-Jun-04 23:22 
GeneralSelect File Control. Pin
zooosta22-Jun-04 20:52
zooosta22-Jun-04 20:52 
GeneralRe: Select File Control. Pin
V.22-Jun-04 21:24
professionalV.22-Jun-04 21:24 
GeneralRe: Select File Control. Pin
zooosta23-Jun-04 13:10
zooosta23-Jun-04 13:10 
GeneralRegQueryValueEx Pin
22-Jun-04 20:16
suss22-Jun-04 20:16 
GeneralRe: RegQueryValueEx Pin
Sir.Ixildore22-Jun-04 20:38
Sir.Ixildore22-Jun-04 20:38 
QuestionHow to change caption of a button on a property page? Pin
Rajesh_K_Sharma22-Jun-04 19:29
Rajesh_K_Sharma22-Jun-04 19:29 
AnswerRe: How to change caption of a button on a property page? Pin
Antony M Kancidrowski22-Jun-04 23:34
Antony M Kancidrowski22-Jun-04 23:34 

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.