Click here to Skip to main content
15,922,309 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: window level, window width...in a jpg? Pin
Prakash Nadar6-Oct-05 15:53
Prakash Nadar6-Oct-05 15:53 
Questioncast operator overloading Pin
Chintoo7236-Oct-05 2:51
Chintoo7236-Oct-05 2:51 
AnswerRe: cast operator overloading Pin
Chintoo7236-Oct-05 3:07
Chintoo7236-Oct-05 3:07 
GeneralRe: cast operator overloading Pin
Chintoo7236-Oct-05 3:09
Chintoo7236-Oct-05 3:09 
GeneralRe: cast operator overloading Pin
toxcct6-Oct-05 3:47
toxcct6-Oct-05 3:47 
GeneralRe: cast operator overloading Pin
Prakash Nadar6-Oct-05 16:03
Prakash Nadar6-Oct-05 16:03 
AnswerRe: cast operator overloading Pin
icabod6-Oct-05 4:09
icabod6-Oct-05 4:09 
AnswerRe: cast operator overloading Pin
Bob Stanneveld6-Oct-05 10:36
Bob Stanneveld6-Oct-05 10:36 
Hello,

I don't have VStudio installed here so I don't know if this works:
#ifdef const_cast
#undef const_cast
#endif // const_cast

#define const_cast                          \
char* const_cast(const char* psArg)         \
{                                           \
    /* cause a compile time assert here */  \
}


Note here that you influence the global namespace here and other developers might dislike this "feature". Also remember that using cons_cast to manipulate objects that shouldn't be manipulated is asking for trouble. So it's the responsibility of the developer who is using your class, that he is using it wisely. So don't bother too much to make your class "fool proof" somehow someone will find a way to prove you wrong!

Behind every great black man...
            ... is the police. - Conspiracy brother


Blog[^]

-- modified at 16:40 Thursday 6th October, 2005
QuestionNetwork address translation help needed ! Pin
Radu Sorin6-Oct-05 2:49
Radu Sorin6-Oct-05 2:49 
Questiondisable quickedit in command window Pin
Ken Goguen6-Oct-05 1:36
Ken Goguen6-Oct-05 1:36 
AnswerRe: disable quickedit in command window Pin
andre123451-May-09 3:38
andre123451-May-09 3:38 
QuestionUnicode font identification Pin
Nishad S6-Oct-05 1:34
Nishad S6-Oct-05 1:34 
QuestionHow to set Icon for EXE ? Pin
Amarelia6-Oct-05 0:45
Amarelia6-Oct-05 0:45 
AnswerRe: How to set Icon for EXE ? Pin
Rage6-Oct-05 1:05
professionalRage6-Oct-05 1:05 
AnswerRe: How to set Icon for EXE ? Pin
Eytukan6-Oct-05 1:46
Eytukan6-Oct-05 1:46 
GeneralRe: How to set Icon for EXE ? Pin
Amarelia6-Oct-05 1:54
Amarelia6-Oct-05 1:54 
GeneralRe: How to set Icon for EXE ? Pin
Eytukan6-Oct-05 3:16
Eytukan6-Oct-05 3:16 
GeneralRe: How to set Icon for EXE ? Pin
toxcct6-Oct-05 3:51
toxcct6-Oct-05 3:51 
AnswerRe: How to set Icon for EXE ? Pin
David Crow6-Oct-05 2:24
David Crow6-Oct-05 2:24 
QuestionOnLvnEndlabeledit Pin
karmendra_js6-Oct-05 0:05
karmendra_js6-Oct-05 0:05 
AnswerRe: OnLvnEndlabeledit Pin
Jose Lamas Rios6-Oct-05 19:42
Jose Lamas Rios6-Oct-05 19:42 
QuestionLinux c++ management of processes Pin
JensB5-Oct-05 23:07
JensB5-Oct-05 23:07 
AnswerRe: Linux c++ management of processes Pin
karmendra_js5-Oct-05 23:46
karmendra_js5-Oct-05 23:46 
AnswerRe: Linux c++ management of processes Pin
Gary R. Wheeler9-Oct-05 4:43
Gary R. Wheeler9-Oct-05 4:43 
QuestionListCtrl Pin
karmendra_js5-Oct-05 22:20
karmendra_js5-Oct-05 22:20 

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.