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

C / C++ / MFC

 
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 
GeneralC++ STL help... using pointer in STL map Pin
Indrawati22-Jun-04 23:36
Indrawati22-Jun-04 23:36 
Hi I have created a class (class A) that manages a number of image. The images' pixel values are stored as unsigned char *. These images are destroyed using delete[] in A's destructor. Another class, class B, in turn manages a number of A objects, and each A object is assigned a unique ID. At first I was planning to declare something like:

std::map<unsigned int, A> m_mA;

in B. My concern is, when I insert a new element to m_mA using:

std::pair<unsigned int, A> pTmp(A_UNIQUE_ID, AN_A_OBJECT);
m_mA.insert(pTmp);

a copy of AN_A_OBJECT will be created and destroyed, invalidating AN_A_OBJECT's pointer to the pixel values. Is this correct?

If it's correct, one possible solution may be defining a copy constructor and assigment operator for A that take care of this issue, although I'm not sure whether this is the most elegant solution. Another possible solution, although I find it very_very strange, is to use 2D vector instead of unsigned char* to store the pixel values. Could someone tell me how I can overcome this? Hopefully the solution does not require me to use classical arrays....

Thanks!
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 
Generalalert messages Pin
ask_you22-Jun-04 19:12
ask_you22-Jun-04 19:12 

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.