Click here to Skip to main content
15,893,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: registerhotkey function affects other applications when my app is still running Pin
Jayapal Chandran5-Aug-10 11:55
Jayapal Chandran5-Aug-10 11:55 
QuestionHow to get the Selected Item from CListControl Pin
Sakhalean4-Aug-10 20:30
Sakhalean4-Aug-10 20:30 
QuestionRe: How to get the Selected Item from CListControl Pin
CPallini4-Aug-10 21:04
mveCPallini4-Aug-10 21:04 
QuestionIs it ok to use uninitialized pointer? Pin
Sameerkumar Namdeo4-Aug-10 18:46
Sameerkumar Namdeo4-Aug-10 18:46 
AnswerRe: Is it ok to use uninitialized pointer? Pin
«_Superman_»4-Aug-10 19:15
professional«_Superman_»4-Aug-10 19:15 
GeneralRe: Is it ok to use uninitialized pointer? Pin
Rick York4-Aug-10 19:34
mveRick York4-Aug-10 19:34 
GeneralRe: Is it ok to use uninitialized pointer? [modified] Pin
Cedric Moonen4-Aug-10 20:48
Cedric Moonen4-Aug-10 20:48 
GeneralRe: Is it ok to use uninitialized pointer? Pin
CPallini4-Aug-10 20:57
mveCPallini4-Aug-10 20:57 
GeneralRe: Is it ok to use uninitialized pointer? Pin
Cedric Moonen4-Aug-10 21:07
Cedric Moonen4-Aug-10 21:07 
GeneralRe: Is it ok to use uninitialized pointer? Pin
CPallini4-Aug-10 21:15
mveCPallini4-Aug-10 21:15 
AnswerRe: Is it ok to use uninitialized pointer? [modified] Pin
bleedingfingers4-Aug-10 21:19
bleedingfingers4-Aug-10 21:19 
AnswerRe: Is it ok to use uninitialized pointer? Pin
Sameerkumar Namdeo4-Aug-10 23:17
Sameerkumar Namdeo4-Aug-10 23:17 
AnswerRe: Is it ok to use uninitialized pointer? Pin
MuraliKrishnaP5-Aug-10 9:44
MuraliKrishnaP5-Aug-10 9:44 
Questionwhy const pointer is NOT const? how to solve the problem? Pin
includeh104-Aug-10 13:12
includeh104-Aug-10 13:12 
AnswerRe: why const pointer is NOT const? how to solve the problem? PinPopular
KingsGambit4-Aug-10 17:02
KingsGambit4-Aug-10 17:02 
AnswerRe: why const pointer is NOT const? how to solve the problem? Pin
Aescleal5-Aug-10 0:02
Aescleal5-Aug-10 0:02 
Most compilers can detect use of uninitialised pointers. Try cranking the warning level up and flagging warnings as errors (/W4 /WX on VC++ and gcc IIRC).

If you want to make sure that pointers are initialised before use there is a solution - don't use pointers. There's really no reason to use raw pointers these days (apart from compatibility with code written in C). Pointers have three uses and there's a better solution for all of them:

- marking ownership - instead use a smart pointer, even std::auto_ptr is usable with a few caveats

- iteration - use containers and use iterators from the containers

- referring to other objects - use references if the object can't be rebound, a smart pointer if it can.

Now onto the const bit... You've read the type wrong. What you've got isn't a "constant pointer" but a "pointer to a constant object". C and C++ have slightly strange declarators in that you don't read them left to right but identifier outwards in precedence order.

Cheers,

Ash
QuestionHow to get physical memory size available to a process? Pin
Code-o-mat4-Aug-10 11:25
Code-o-mat4-Aug-10 11:25 
QuestionRe: How to get physical memory size available to a process? Pin
norish5-Aug-10 4:38
norish5-Aug-10 4:38 
AnswerRe: How to get physical memory size available to a process? Pin
Code-o-mat5-Aug-10 4:54
Code-o-mat5-Aug-10 4:54 
GeneralRe: How to get physical memory size available to a process? Pin
norish5-Aug-10 19:48
norish5-Aug-10 19:48 
GeneralRe: How to get physical memory size available to a process? Pin
Code-o-mat5-Aug-10 21:55
Code-o-mat5-Aug-10 21:55 
QuestionGet/Kill focus in MFC Pin
geoyar4-Aug-10 9:23
professionalgeoyar4-Aug-10 9:23 
AnswerRe: Get/Kill focus in MFC Pin
Code-o-mat4-Aug-10 11:15
Code-o-mat4-Aug-10 11:15 
GeneralRe: Get/Kill focus in MFC Pin
geoyar5-Aug-10 12:19
professionalgeoyar5-Aug-10 12:19 
GeneralRe: Get/Kill focus in MFC Pin
Code-o-mat5-Aug-10 21:52
Code-o-mat5-Aug-10 21:52 

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.