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

C / C++ / MFC

 
AnswerRe: Multi Threaded program With allegro. Pin
Andrew Brock23-Jan-11 23:54
Andrew Brock23-Jan-11 23:54 
GeneralRe: Multi Threaded program With allegro. Pin
Thilina.madush24-Jan-11 0:02
Thilina.madush24-Jan-11 0:02 
GeneralRe: Multi Threaded program With allegro. Pin
Andrew Brock24-Jan-11 0:07
Andrew Brock24-Jan-11 0:07 
QuestionHow to set a icon to the column of the CListCtrl Pin
yu-jian23-Jan-11 21:06
yu-jian23-Jan-11 21:06 
AnswerRe: How to set a icon to the column of the CListCtrl Pin
ShilpiP23-Jan-11 22:45
ShilpiP23-Jan-11 22:45 
AnswerRe: How to set a icon to the column of the CListCtrl Pin
David Crow24-Jan-11 4:21
David Crow24-Jan-11 4:21 
QuestionMouse move over Tray Icon, the icon disappear. [modified][Solved] Pin
yu-jian23-Jan-11 14:47
yu-jian23-Jan-11 14:47 
AnswerRe: Mouse move over Tray Icon, the icon disappear. Pin
Stephen Hewitt23-Jan-11 19:28
Stephen Hewitt23-Jan-11 19:28 
AnswerRe: Mouse move over Tray Icon, the icon disappear. Pin
Malli_S23-Jan-11 23:05
Malli_S23-Jan-11 23:05 
GeneralRe: Mouse move over Tray Icon, the icon disappear. Pin
yu-jian24-Jan-11 0:45
yu-jian24-Jan-11 0:45 
GeneralRe: Mouse move over Tray Icon, the icon disappear. Pin
Stephen Hewitt24-Jan-11 1:43
Stephen Hewitt24-Jan-11 1:43 
GeneralRe: Mouse move over Tray Icon, the icon disappear. Pin
Malli_S24-Jan-11 2:05
Malli_S24-Jan-11 2:05 
GeneralRe: Mouse move over Tray Icon, the icon disappear. Pin
yu-jian24-Jan-11 15:32
yu-jian24-Jan-11 15:32 
GeneralRe: Mouse move over Tray Icon, the icon disappear. Pin
yu-jian24-Jan-11 15:30
yu-jian24-Jan-11 15:30 
Questionwhat is wrong with this code? Pin
aesthetic.crazy22-Jan-11 8:41
aesthetic.crazy22-Jan-11 8:41 
AnswerRe: what is wrong with this code? Pin
PIEBALDconsult22-Jan-11 10:15
mvePIEBALDconsult22-Jan-11 10:15 
AnswerRe: what is wrong with this code? Pin
CPallini22-Jan-11 10:39
mveCPallini22-Jan-11 10:39 
AnswerRe: what is wrong with this code? Pin
T210222-Jan-11 13:08
T210222-Jan-11 13:08 
AnswerRe: what is wrong with this code? [modified] Pin
Richard MacCutchan22-Jan-11 21:35
mveRichard MacCutchan22-Jan-11 21:35 
AnswerRe: what is wrong with this code? Pin
Aescleal23-Jan-11 6:34
Aescleal23-Jan-11 6:34 
Aside from the fact that the code doesn't do anything useful, the really serious problems with this class are:

- It will leak in normal operation (I use the term "operation" loosely here as the class doesn't do anything)
- It isn't exception safe or neutral

To fix these you're going to need a destructor, a copy constructor (or a private declaration of a copy constructor) and a swapping assignment operator (or a private declaration of an assignment operator).

In addition (ignoring the questionable sanity of storing an int like that) the implementation could be tightened up to use an initialiser list.

The idea here is to make a class that behaves like a object of a type built into the language. The structure your class needs to achieve this is known in some circles as "The Orthodox Canonical Form" and the first place I saw it mentioned and explained properly was in "Advanced C++: Programming Styles and Idioms" By Jim Coplien back in the early 90s. Other authors have picked up the term since then so a search for it might give you some more background.

Cheers,

Ash
GeneralRe: what is wrong with this code? Pin
Adam Roderick J23-Jan-11 19:04
Adam Roderick J23-Jan-11 19:04 
GeneralRe: what is wrong with this code? Pin
PIEBALDconsult24-Jan-11 2:02
mvePIEBALDconsult24-Jan-11 2:02 
AnswerRe: what is wrong with this code? [modified] Pin
Stefan_Lang30-Jan-11 23:54
Stefan_Lang30-Jan-11 23:54 
QuestionRetaining whitespace within macro replacement text Pin
PIEBALDconsult22-Jan-11 4:17
mvePIEBALDconsult22-Jan-11 4:17 
AnswerRe: Retaining whitespace within macro replacement text Pin
Andrew Brock22-Jan-11 4:38
Andrew Brock22-Jan-11 4:38 

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.