Click here to Skip to main content
15,920,687 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Exception caught but not handled completely Pin
led mike20-May-08 11:46
led mike20-May-08 11:46 
QuestionMFC components and minGW... Pin
greghint20-May-08 9:58
greghint20-May-08 9:58 
AnswerRe: MFC components and minGW... Pin
Rajkumar R20-May-08 20:08
Rajkumar R20-May-08 20:08 
GeneralRe: MFC components and minGW... Pin
greghint11-Jun-08 16:27
greghint11-Jun-08 16:27 
Questioninitial position of pop-up dialog box Pin
Kwanalouie20-May-08 7:45
Kwanalouie20-May-08 7:45 
AnswerRe: initial position of pop-up dialog box Pin
David Crow20-May-08 7:48
David Crow20-May-08 7:48 
AnswerRe: initial position of pop-up dialog box Pin
Nelek21-May-08 6:56
protectorNelek21-May-08 6:56 
QuestionLoss of data using CList::AddTail() Pin
piul20-May-08 5:55
piul20-May-08 5:55 
Hello World,

I have a simple class
class CData
{
public:
   CData ()      {}
   CData (CObj obj, unsigned short a)   {m_obj = obj ;  m_a = a ; }
private:
   unsigned short m_a ;
   CObj m_obj ;
};

and a list of this type of object
typedef CList < CData, CData& > CDataList ;


Something odd happens when
CObj Obj ;        //...
unsigned short a = 10 ;
CDataList TheList ;
TheList.AddTail(CData(Obj, a)) ; 

TheList has one more element, and the data in m_obj is perfect. However, the value in m_a is not correct! It gets a random value.

If I change the default constructor to
CData(unsigned short a = 5)    { m_a = a ; }

and do the same thing TheList.AddTail(CData(Obj, a)) ; m_a equals 5 (that is, the default value in the default constructor) and not the value passed when constructing the object...

I've tried to reproduce this problem in a different project and I can't. I guess there is something wrong with one of the classes I've defined. Any idea??Confused | :confused:
QuestionRe: Loss of data using CList::AddTail() Pin
Ernest Laurentin20-May-08 7:51
Ernest Laurentin20-May-08 7:51 
QuestionRe: Loss of data using CList::AddTail() Pin
David Crow20-May-08 7:55
David Crow20-May-08 7:55 
QuestionHow can i copy raw image buffer to a dc? Pin
Soumyadipta20-May-08 5:09
Soumyadipta20-May-08 5:09 
AnswerRe: How can i copy raw image buffer to a dc? Pin
CPallini20-May-08 6:22
mveCPallini20-May-08 6:22 
GeneralRe: How can i copy raw image buffer to a dc? Pin
Soumyadipta20-May-08 18:49
Soumyadipta20-May-08 18:49 
GeneralRe: How can i copy raw image buffer to a dc? Pin
CPallini20-May-08 21:09
mveCPallini20-May-08 21:09 
GeneralRe: How can i copy raw image buffer to a dc? Pin
Soumyadipta20-May-08 23:08
Soumyadipta20-May-08 23:08 
GeneralRe: How can i copy raw image buffer to a dc? Pin
CPallini20-May-08 23:47
mveCPallini20-May-08 23:47 
GeneralRe: How can i copy raw image buffer to a dc? Pin
Soumyadipta21-May-08 0:26
Soumyadipta21-May-08 0:26 
GeneralRe: How can i copy raw image buffer to a dc? Pin
CPallini21-May-08 1:07
mveCPallini21-May-08 1:07 
GeneralRe: How can i copy raw image buffer to a dc? Pin
Soumyadipta21-May-08 1:55
Soumyadipta21-May-08 1:55 
GeneralRe: How can i copy raw image buffer to a dc? Pin
CPallini21-May-08 2:10
mveCPallini21-May-08 2:10 
QuestionFinding only GDI leaks Pin
Super Hornet20-May-08 4:58
Super Hornet20-May-08 4:58 
AnswerRe: Finding only GDI leaks Pin
Hamid_RT20-May-08 7:34
Hamid_RT20-May-08 7:34 
AnswerRe: Finding only GDI leaks Pin
dosler15-Jan-09 22:54
dosler15-Jan-09 22:54 
QuestionHelp with C++ MFC syntax Pin
Kwanalouie20-May-08 3:28
Kwanalouie20-May-08 3:28 
AnswerRe: Help with C++ MFC syntax Pin
David Crow20-May-08 3:36
David Crow20-May-08 3:36 

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.