Click here to Skip to main content
15,899,634 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCompare XMLs Pin
josepe325212-Nov-09 23:46
josepe325212-Nov-09 23:46 
QuestionCheck windows TaskManager Pin
MsmVc12-Nov-09 23:44
MsmVc12-Nov-09 23:44 
QuestionRe: Check windows TaskManager Pin
David Crow13-Nov-09 3:17
David Crow13-Nov-09 3:17 
AnswerRe: Check windows TaskManager Pin
MsmVc13-Nov-09 17:09
MsmVc13-Nov-09 17:09 
QuestionRe: Check windows TaskManager Pin
David Crow13-Nov-09 17:16
David Crow13-Nov-09 17:16 
Questiontypecasting Pin
FotisSs12-Nov-09 23:21
FotisSs12-Nov-09 23:21 
AnswerRe: typecasting Pin
Cedric Moonen12-Nov-09 23:31
Cedric Moonen12-Nov-09 23:31 
AnswerRe: typecasting Pin
Rajesh R Subramanian12-Nov-09 23:39
professionalRajesh R Subramanian12-Nov-09 23:39 
Usage of things like char is what scaring me more than the typecasts. One should ideally use TCHAR instead, which is neutral to builds (and is defined as char in an ANSI build and as a wchar_t in an Unicode build).

If an API expects an LPCTSTR, that means that it has both an ANSI and an Unicode implementation and the appropriate version will be called based on the build (for Unicode build, CreateFileW and for an ANSI build, CreateFileA will be called).

There is no excuse to use char unless you're *sure* that you are always going to do an ANSI only build. Even then, I won't recommend it.

Typecasting a char* to an LPCTSTR in an Unicode build is an invitation to disaster, because the wide version of the API will be called, which is going to expect a wchar_t*.

There is no excuse to write such crap code.


“Follow your bliss.” – Joseph Campbell

GeneralRe: typecasting Pin
FotisSs12-Nov-09 23:52
FotisSs12-Nov-09 23:52 
AnswerRe: typecasting Pin
Rajesh R Subramanian13-Nov-09 0:15
professionalRajesh R Subramanian13-Nov-09 0:15 
AnswerRe: typecasting Pin
David Crow13-Nov-09 3:25
David Crow13-Nov-09 3:25 
Questionlinking exe to DLLs with the same name as the system dlls Pin
RohanBhosale2112-Nov-09 23:06
RohanBhosale2112-Nov-09 23:06 
AnswerRe: linking exe to DLLs with the same name as the system dlls Pin
Rajesh R Subramanian12-Nov-09 23:26
professionalRajesh R Subramanian12-Nov-09 23:26 
GeneralRe: linking exe to DLLs with the same name as the system dlls Pin
RohanBhosale2115-Nov-09 18:18
RohanBhosale2115-Nov-09 18:18 
Questionis there any free PDF printers drivers or pdf libraries Pin
eswar pothula12-Nov-09 22:04
eswar pothula12-Nov-09 22:04 
AnswerRe: is there any free PDF printers drivers or pdf libraries Pin
Richard MacCutchan12-Nov-09 22:19
mveRichard MacCutchan12-Nov-09 22:19 
AnswerRe: is there any free PDF printers drivers or pdf libraries Pin
Rajesh R Subramanian12-Nov-09 22:28
professionalRajesh R Subramanian12-Nov-09 22:28 
QuestionBlock Worlds Problem Pin
Jim_Long12-Nov-09 21:37
Jim_Long12-Nov-09 21:37 
QuestionRe: Block Worlds Problem Pin
CPallini12-Nov-09 21:46
mveCPallini12-Nov-09 21:46 
AnswerRe: Block Worlds Problem Pin
Richard MacCutchan12-Nov-09 22:24
mveRichard MacCutchan12-Nov-09 22:24 
JokeRe: Block Worlds Problem Pin
Covean12-Nov-09 22:56
Covean12-Nov-09 22:56 
GeneralRe: Block Worlds Problem Pin
Richard MacCutchan12-Nov-09 23:19
mveRichard MacCutchan12-Nov-09 23:19 
GeneralRe: Block Worlds Problem Pin
Jim_Long13-Nov-09 2:02
Jim_Long13-Nov-09 2:02 
AnswerRe: Block Worlds Problem Pin
David Crow13-Nov-09 3:37
David Crow13-Nov-09 3:37 
GeneralRe: Block Worlds Problem Pin
Richard MacCutchan13-Nov-09 5:11
mveRichard MacCutchan13-Nov-09 5:11 

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.