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

C / C++ / MFC

 
GeneralRe: RAS events Pin
Masaaki Onishi15-Nov-01 17:07
Masaaki Onishi15-Nov-01 17:07 
GeneralOwner drawn button with drop-down menu Pin
Derek Lakin15-Nov-01 3:35
Derek Lakin15-Nov-01 3:35 
QuestionWhen to delete, and when to NULL? Pin
Chambers15-Nov-01 3:33
Chambers15-Nov-01 3:33 
AnswerRe: When to delete, and when to NULL? Pin
Nish Nishant15-Nov-01 3:50
sitebuilderNish Nishant15-Nov-01 3:50 
AnswerRe: When to delete, and when to NULL? Pin
Jon Sagara15-Nov-01 4:53
Jon Sagara15-Nov-01 4:53 
GeneralRe: When to delete, and when to NULL? Pin
Ray Kinsella15-Nov-01 6:02
Ray Kinsella15-Nov-01 6:02 
GeneralRe: When to delete, and when to NULL? Pin
Jon Sagara15-Nov-01 6:46
Jon Sagara15-Nov-01 6:46 
GeneralRe: When to delete, and when to NULL? Pin
Jim A. Johnson15-Nov-01 6:08
Jim A. Johnson15-Nov-01 6:08 
Jon Sagara wrote:
When doing comparisons, put the constant value on the LHS of the comparison operator:

if (NULL == m_pPointer)


If you happen to accidentally leave off one of the equal signs (i.e., NULL = m_pPointer), your code won't compile because you can't assign a value to a literal.


Here's a better tip:

Write it in the readable fashion, as you did, eg:

if (m_pointer == NULL)

and then use the following pragma to prevent assignments in the body of an if statement:

#pragma warning(error : 4706) // Assignment in conditional

This keeps your code readable and safe at the same time. And while the pragma is not portable, the resulting safe, readable code is.
GeneralRe: When to delete, and when to NULL? Pin
Jon Sagara15-Nov-01 6:50
Jon Sagara15-Nov-01 6:50 
GeneralRe: When to delete, and when to NULL? Pin
Michael Dunn15-Nov-01 9:11
sitebuilderMichael Dunn15-Nov-01 9:11 
GeneralRe: When to delete, and when to NULL? Pin
Jon Sagara15-Nov-01 10:58
Jon Sagara15-Nov-01 10:58 
GeneralRe: When to delete, and when to NULL? Pin
Jim A. Johnson15-Nov-01 12:15
Jim A. Johnson15-Nov-01 12:15 
GeneralRe: When to delete, and when to NULL? Pin
Jon Sagara15-Nov-01 12:36
Jon Sagara15-Nov-01 12:36 
GeneralRe: When to delete, and when to NULL? Pin
Tim Smith15-Nov-01 12:54
Tim Smith15-Nov-01 12:54 
GeneralRe: When to delete, and when to NULL? Pin
Colin Urquhart15-Nov-01 15:47
Colin Urquhart15-Nov-01 15:47 
GeneralRe: When to delete, and when to NULL? Pin
Michael Dunn15-Nov-01 19:07
sitebuilderMichael Dunn15-Nov-01 19:07 
GeneralRe: When to delete, and when to NULL? Pin
#realJSOP16-Nov-01 0:50
professional#realJSOP16-Nov-01 0:50 
AnswerRe: When to delete, and when to NULL? Pin
Gert Boddaert15-Nov-01 5:06
Gert Boddaert15-Nov-01 5:06 
AnswerRe: Thankyou All. Pin
Chambers15-Nov-01 9:32
Chambers15-Nov-01 9:32 
QuestionHow can I open default mail client from my app in VC? Pin
Karavaev Denis15-Nov-01 2:07
Karavaev Denis15-Nov-01 2:07 
AnswerRe: How can I open default mail client from my app in VC? Pin
Nish Nishant15-Nov-01 2:18
sitebuilderNish Nishant15-Nov-01 2:18 
GeneralIt's only opening New message window. I need all programm(etc Outlook, The bat, opera ...) Pin
Karavaev Denis15-Nov-01 3:01
Karavaev Denis15-Nov-01 3:01 
GeneralRe: It's only opening New message window. I need all programm(etc Outlook, The bat, opera ...) Pin
Nish Nishant15-Nov-01 3:10
sitebuilderNish Nishant15-Nov-01 3:10 
GeneralRe: It's only opening New message window. I need all programm(etc Outlook, The bat, opera ...) Pin
15-Nov-01 3:14
suss15-Nov-01 3:14 
GeneralRe: It's only opening New message window. I need all programm(etc Outlook, The bat, opera ...) Pin
Nish Nishant15-Nov-01 3:29
sitebuilderNish Nishant15-Nov-01 3:29 

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.