Click here to Skip to main content
15,895,709 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: CreateProcess problem in Windows service for Visual Studio c++ 2008 Pin
Chris Meech6-Jan-11 9:54
Chris Meech6-Jan-11 9:54 
QuestionCArray storage options Pin
David Crow5-Jan-11 10:12
David Crow5-Jan-11 10:12 
AnswerRe: CArray storage options Pin
CPallini5-Jan-11 10:36
mveCPallini5-Jan-11 10:36 
QuestionRe: CArray storage options Pin
David Crow5-Jan-11 10:50
David Crow5-Jan-11 10:50 
AnswerRe: CArray storage options Pin
CPallini5-Jan-11 11:05
mveCPallini5-Jan-11 11:05 
GeneralRe: CArray storage options Pin
David Crow5-Jan-11 17:22
David Crow5-Jan-11 17:22 
GeneralRe: CArray storage options Pin
CPallini6-Jan-11 3:59
mveCPallini6-Jan-11 3:59 
AnswerRe: CArray storage options PinPopular
Aescleal5-Jan-11 11:37
Aescleal5-Jan-11 11:37 
I wouldn't store raw pointers in a collection. As a general rule always keep some kind of object in there - either what you're trying to store or some reference like object. If you keep raw pointers in there you'll end up with exception safety and potential aliasing problems.

So the rule of thumb I use is: If you want to maintain a collection of objects of a single type then store them by value. If you want to maintain a collection of objects and access them polymorphically store something like std::shared_ptr or std::unique_ptr.

Cheers,

Ash

PS: One final point - using CArray is a bad idea - it breaks fairly often when using non-POD objects (it uses a really naive internal copy based on memcpy) and is really conservative when it has to grow.
AnswerRe: CArray storage options Pin
Maximilien6-Jan-11 1:08
Maximilien6-Jan-11 1:08 
AnswerRe: CArray storage options Pin
Nemanja Trifunovic6-Jan-11 3:52
Nemanja Trifunovic6-Jan-11 3:52 
GeneralRe: CArray storage options Pin
bob169726-Jan-11 11:24
bob169726-Jan-11 11:24 
AnswerRe: CArray storage options Pin
bob169726-Jan-11 11:15
bob169726-Jan-11 11:15 
QuestionSaving a web page as image Pin
eight5-Jan-11 5:56
eight5-Jan-11 5:56 
AnswerRe: Saving a web page as image Pin
RaviRanjanKr5-Jan-11 6:39
professionalRaviRanjanKr5-Jan-11 6:39 
GeneralRe: Saving a web page as image Pin
eight5-Jan-11 15:04
eight5-Jan-11 15:04 
Questionsimple string problem - Noob Pin
Paul Hasler5-Jan-11 3:37
Paul Hasler5-Jan-11 3:37 
AnswerRe: simple string problem - Noob Pin
User 74293385-Jan-11 3:50
professionalUser 74293385-Jan-11 3:50 
GeneralRe: simple string problem - Noob Pin
Paul Hasler5-Jan-11 4:00
Paul Hasler5-Jan-11 4:00 
AnswerRe: simple string problem - Noob Pin
guyee5-Jan-11 3:51
guyee5-Jan-11 3:51 
GeneralRe: simple string problem - Noob Pin
Paul Hasler5-Jan-11 4:01
Paul Hasler5-Jan-11 4:01 
Questionfatal error LNK1561 entry point must be defined Pin
Joao Araujo5-Jan-11 3:27
Joao Araujo5-Jan-11 3:27 
QuestionRe: fatal error LNK1561 entry point must be defined Pin
David Crow5-Jan-11 4:57
David Crow5-Jan-11 4:57 
Questionhow can find how thread running in my application Pin
Le@rner4-Jan-11 23:56
Le@rner4-Jan-11 23:56 
AnswerRe: how can find how thread running in my application [modified] Pin
Nuri Ismail5-Jan-11 0:04
Nuri Ismail5-Jan-11 0:04 
GeneralRe: how can find how thread running in my application Pin
Le@rner5-Jan-11 1:12
Le@rner5-Jan-11 1: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.