Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: wcscpy_s issues [modified] Pin
Nish Nishant2-Jun-06 5:22
sitebuilderNish Nishant2-Jun-06 5:22 
QuestionRe: wcscpy_s issues [modified] Pin
David Crow2-Jun-06 5:33
David Crow2-Jun-06 5:33 
AnswerRe: wcscpy_s issues [modified] Pin
Viorel.2-Jun-06 5:33
Viorel.2-Jun-06 5:33 
AnswerRe: wcscpy_s issues [modified] Pin
Zac Howland2-Jun-06 5:36
Zac Howland2-Jun-06 5:36 
GeneralRe: wcscpy_s issues [modified] Pin
Viorel.2-Jun-06 5:42
Viorel.2-Jun-06 5:42 
GeneralRe: wcscpy_s issues [modified] Pin
big_denny_2002-Jun-06 6:03
big_denny_2002-Jun-06 6:03 
GeneralRe: wcscpy_s issues [modified] Pin
Zac Howland2-Jun-06 6:02
Zac Howland2-Jun-06 6:02 
GeneralRe: wcscpy_s issues [modified] Viorel Bejan Pin
big_denny_2002-Jun-06 6:07
big_denny_2002-Jun-06 6:07 
What is happening ? I am replying to Viorel Bejan and this post gooes in reply to Zac Howland's post Confused | :confused:

Viorel Bejan wrote:
Since _tcscpy_s is expanded to wcscpy_s call in Unicode version, you must specify the size of destination buffer in 2-byte unicode characters, not in bytes. Universal solution can look like this:

_tcscpy_s(array,
sizeof(array) / sizeof(TCHAR),
strText);



You got halts even if the source string was short enought, because -- in Debug version -- this function fills the buffer with 0xFD value.


Could you be more explicit ?

MSDN says, that second parameter of wcscpy_s must specify size of destination buffer in bytes, therefore in Unicode build destination size will be 100 * sizeof(TCHAR) (which is equal to sizeof(array)), but in you case it will be 100(which is not the size of destination buffer)

I am little confused.

thanks

-- modified at 12:02 Friday 2nd June, 2006


-- modified at 12:04 Friday 2nd June, 2006
GeneralRe: wcscpy_s issues [modified] Viorel Bejan Pin
George L. Jackson2-Jun-06 8:17
George L. Jackson2-Jun-06 8:17 
GeneralRe: wcscpy_s issues [modified] Viorel Bejan Pin
big_denny_2002-Jun-06 8:25
big_denny_2002-Jun-06 8:25 
GeneralRe: wcscpy_s issues [modified] Viorel Bejan Pin
George L. Jackson2-Jun-06 11:14
George L. Jackson2-Jun-06 11:14 
GeneralRe: wcscpy_s issues [modified] Pin
Nish Nishant2-Jun-06 6:11
sitebuilderNish Nishant2-Jun-06 6:11 
AnswerRe: wcscpy_s issues [modified] Pin
Nemanja Trifunovic2-Jun-06 5:41
Nemanja Trifunovic2-Jun-06 5:41 
GeneralRe: wcscpy_s issues [modified] Pin
Nish Nishant2-Jun-06 6:10
sitebuilderNish Nishant2-Jun-06 6:10 
AnswerRe: wcscpy_s issues [modified] Pin
georgeraafat2-Jun-06 15:06
georgeraafat2-Jun-06 15:06 
QuestionWndows application with buttons and controls Pin
LCI2-Jun-06 4:47
LCI2-Jun-06 4:47 
QuestionRe: Wndows application with buttons and controls Pin
David Crow2-Jun-06 5:12
David Crow2-Jun-06 5:12 
AnswerRe: Wndows application with buttons and controls Pin
LCI2-Jun-06 5:25
LCI2-Jun-06 5:25 
GeneralRe: Wndows application with buttons and controls Pin
David Crow2-Jun-06 5:31
David Crow2-Jun-06 5:31 
QuestionDialog events not showing Pin
ldaoust2-Jun-06 3:48
ldaoust2-Jun-06 3:48 
AnswerRe: Dialog events not showing Pin
Viorel.2-Jun-06 4:39
Viorel.2-Jun-06 4:39 
GeneralRe: Dialog events not showing Pin
ldaoust2-Jun-06 6:27
ldaoust2-Jun-06 6:27 
AnswerRe: Dialog events not showing (problem solved) [modified] Pin
ldaoust11-Jul-06 3:52
ldaoust11-Jul-06 3:52 
QuestionStatic registry for classfactory handles Pin
rana742-Jun-06 2:20
rana742-Jun-06 2:20 
QuestionForeground process Pin
KKumarTG2-Jun-06 2:20
KKumarTG2-Jun-06 2: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.