Click here to Skip to main content
15,913,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to get/set the position of buttons, ListCtrl etc.? Pin
SJolly20-Jan-04 2:21
SJolly20-Jan-04 2:21 
AnswerRe: How to get/set the position of buttons, ListCtrl etc.? Pin
David Crow20-Jan-04 2:56
David Crow20-Jan-04 2:56 
QuestionAnybody who knows about Visual C++ Speech applications? Pin
satcat20-Jan-04 1:20
satcat20-Jan-04 1:20 
GeneralLoading Bitmap over the Button Pin
P. Gnana Prakash20-Jan-04 1:11
P. Gnana Prakash20-Jan-04 1:11 
GeneralRe: Loading Bitmap over the Button Pin
Monty220-Jan-04 1:48
Monty220-Jan-04 1:48 
GeneralRe: Loading Bitmap over the Button Pin
Anonymous20-Jan-04 1:57
Anonymous20-Jan-04 1:57 
GeneralRe: Loading Bitmap over the Button Pin
David Crow20-Jan-04 2:57
David Crow20-Jan-04 2:57 
GeneralMFC Clist and adding new objects Pin
Anonymous20-Jan-04 0:37
Anonymous20-Jan-04 0:37 
Sorry my question is long. I try to use colour and fonts to make it clear.

I have a class and I now want to make a list of my objects and so I want to make a class which is a list of my objects.

So I have my object: CMyObject

My list of my objects: CMyObjectList

CMyObjectList has a CList member which is declared like this:

CList <CMyObject, CMyObject> m_ObjectList;


I have a member function in my CMyObjectList class called addMyObject().

Now my question: should I add a CMyObject instance by pointer or by reference? When I add CMyObject to my list should I create a new object in the add() member function so that my caller can delete his copy or allow it to go out of scope? Does the CList addToTail() function create a copy? What is good form for this sort of problem? Should the list create a completely new object to store or should the client make sure the object is not deleted or go out of scope?

Example:

...
CMyObjectList myList;
CMyObject myObject;

myList.add(myObject)
myList.add(&myObject)
...

CMyObjectList.add(CMyObject myObject)
{
...
}
 
CMyObjectList.add(CMyObject *myObject) 
{
...
}

Thank you.
GeneralRe: MFC Clist and adding new objects Pin
Mike Dimmick20-Jan-04 2:02
Mike Dimmick20-Jan-04 2:02 
Questionhow can i define a new language in VC++ ?? Pin
cyberiafreak20-Jan-04 0:34
cyberiafreak20-Jan-04 0:34 
AnswerRe: how can i define a new language in VC++ ?? Pin
TrueKaine20-Jan-04 1:09
TrueKaine20-Jan-04 1:09 
GeneralCD3DFont Pin
Exim20-Jan-04 0:01
Exim20-Jan-04 0:01 
GeneralRe: CD3DFont Pin
KaЯl20-Jan-04 23:10
KaЯl20-Jan-04 23:10 
Generalrun .exe file Pin
satcat19-Jan-04 23:41
satcat19-Jan-04 23:41 
GeneralRe: run .exe file Pin
MeWithNoName20-Jan-04 0:00
MeWithNoName20-Jan-04 0:00 
GeneralRe: run .exe file Pin
satcat20-Jan-04 1:01
satcat20-Jan-04 1:01 
GeneralRe: run .exe file Pin
RobJones20-Jan-04 3:56
RobJones20-Jan-04 3:56 
GeneralRe: run .exe file Pin
satcat20-Jan-04 4:42
satcat20-Jan-04 4:42 
Generalcapture packets at the device Pin
styve19-Jan-04 23:25
styve19-Jan-04 23:25 
GeneralRe: capture packets at the device Pin
Artem Moroz20-Jan-04 0:54
Artem Moroz20-Jan-04 0:54 
GeneralTree View Control Pin
SiddharthAtw19-Jan-04 23:15
SiddharthAtw19-Jan-04 23:15 
GeneralPrinting with GUI+ Pin
Burz19-Jan-04 22:59
Burz19-Jan-04 22:59 
GeneralRe: Printing with GUI+ Pin
Roger Allen19-Jan-04 23:29
Roger Allen19-Jan-04 23:29 
GeneralRe: Printing with GUI+ Pin
Burz19-Jan-04 23:42
Burz19-Jan-04 23:42 
GeneralRe: Printing with GUI+ Pin
Roger Allen20-Jan-04 0:34
Roger Allen20-Jan-04 0: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.