Click here to Skip to main content
15,884,629 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionC6 _asm and graphics.h Pin
tuan111124-Jun-09 17:36
tuan111124-Jun-09 17:36 
QuestionRe: C6 _asm and graphics.h Pin
CPallini24-Jun-09 21:06
mveCPallini24-Jun-09 21:06 
QuestionClash between VS 2003 and VS 2005 Pin
rohitgonsalves24-Jun-09 17:14
rohitgonsalves24-Jun-09 17:14 
AnswerRe: Clash between VS 2003 and VS 2005 Pin
Joe Woodbury24-Jun-09 17:37
professionalJoe Woodbury24-Jun-09 17:37 
GeneralRe: Clash between VS 2003 and VS 2005 Pin
rohitgonsalves24-Jun-09 19:30
rohitgonsalves24-Jun-09 19:30 
QuestionMoving to UNICODE Pin
dipuks24-Jun-09 12:36
dipuks24-Jun-09 12:36 
AnswerRe: Moving to UNICODE Pin
PJ Arends24-Jun-09 14:37
professionalPJ Arends24-Jun-09 14:37 
AnswerRe: Moving to UNICODE [modified] Pin
Joe Woodbury24-Jun-09 17:45
professionalJoe Woodbury24-Jun-09 17:45 
To add to the above; go to the documentation for the string calls. Scroll down. The remarks section will contain a list of what the equivalent tchar routine to use that will map to either the ANSI or UNICODE version of functions. So, the equivalent of strcpy_s is _tcscpy_s.

The second parameter of strcpy_s is the number of characters in the destination buffer. If you have a static buffer (i.e. TCHAR buffer[16]) and are using sizeof(buffer), you'll have to modify it to use sizeof(buffer) / sizeof(TCHAR) (in VS 2005 you can, as was already clearly pointed out below, use _countof(buffer).)

dipuks wrote:
that is, while doing a copy, do i need to specifiy more memory?


It depends on how you are allocating that memory. If you use TCHAR when allocating, then you're fine.

BTW, if using the defines LPCSTR & LPSTR, change them to LPCTSTR & LPTSTR. Most of these will be flagged when you compile with UNICODE.


Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke


modified on Wednesday, June 24, 2009 11:53 PM

QuestionI have a question: Why MFC is still used? [modified] Pin
Seraph_summer24-Jun-09 10:35
Seraph_summer24-Jun-09 10:35 
AnswerRe: I have a question: Why MFC is still used? Pin
Stuart Dootson24-Jun-09 10:55
professionalStuart Dootson24-Jun-09 10:55 
AnswerRe: I have a question: Why MFC is still used? Pin
Joe Woodbury24-Jun-09 11:28
professionalJoe Woodbury24-Jun-09 11:28 
QuestionSlideCtrl Pin
siva45524-Jun-09 8:59
siva45524-Jun-09 8:59 
QuestionRe: SlideCtrl Pin
David Crow24-Jun-09 9:12
David Crow24-Jun-09 9:12 
QuestionHow to open a device specific serial port?? Pin
Kiran Satish24-Jun-09 8:14
Kiran Satish24-Jun-09 8:14 
Questionstrcpy_s with WCHAR option Pin
dipuks24-Jun-09 7:38
dipuks24-Jun-09 7:38 
AnswerRe: strcpy_s with WCHAR option Pin
led mike24-Jun-09 8:18
led mike24-Jun-09 8:18 
GeneralRe: strcpy_s with WCHAR option Pin
Rajesh R Subramanian24-Jun-09 9:49
professionalRajesh R Subramanian24-Jun-09 9:49 
GeneralRe: strcpy_s with WCHAR option Pin
led mike24-Jun-09 11:55
led mike24-Jun-09 11:55 
GeneralVOID *function() help Pin
Douglas Kirk24-Jun-09 7:35
Douglas Kirk24-Jun-09 7:35 
GeneralRe: VOID *function() help Pin
bulg24-Jun-09 7:45
bulg24-Jun-09 7:45 
GeneralRe: VOID *function() help Pin
Douglas Kirk24-Jun-09 7:49
Douglas Kirk24-Jun-09 7:49 
GeneralRe: VOID *function() help Pin
Chris Losinger24-Jun-09 9:04
professionalChris Losinger24-Jun-09 9:04 
GeneralRe: VOID *function() help Pin
Douglas Kirk24-Jun-09 9:57
Douglas Kirk24-Jun-09 9:57 
GeneralRe: VOID *function() help Pin
Stuart Dootson24-Jun-09 10:48
professionalStuart Dootson24-Jun-09 10:48 
QuestionInferred Function Pointer Template Parameter Pin
Skippums24-Jun-09 7:25
Skippums24-Jun-09 7:25 

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.