Click here to Skip to main content
15,881,882 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
AnswerRe: better version of strcpy() and printf() Pin
Richard MacCutchan16-Sep-12 0:09
mveRichard MacCutchan16-Sep-12 0:09 
AnswerRe: better version of strcpy() and printf() Pin
pasztorpisti16-Sep-12 1:37
pasztorpisti16-Sep-12 1:37 
AnswerRe: better version of strcpy() and printf() Pin
Stephen Hewitt18-Sep-12 0:29
Stephen Hewitt18-Sep-12 0:29 
Questionget a number into static text control Pin
bkelly1313-Sep-12 17:05
bkelly1313-Sep-12 17:05 
AnswerRe: get a number into static text control Pin
Richard MacCutchan13-Sep-12 21:52
mveRichard MacCutchan13-Sep-12 21:52 
GeneralRe: get a number into static text control Pin
bkelly1314-Sep-12 15:00
bkelly1314-Sep-12 15:00 
GeneralRe: get a number into static text control Pin
Paul M Watt14-Sep-12 15:36
mentorPaul M Watt14-Sep-12 15:36 
GeneralRe: get a number into static text control Pin
Richard MacCutchan14-Sep-12 23:02
mveRichard MacCutchan14-Sep-12 23:02 
bkelly13 wrote:
Note the _s on the end and the L prefixing the "%d"
The _s is a good thing as it helps to protect against buffer overflow, but less critical when you are sure that your buffer is big enough. The L prefix on your string is wrong, however, as you are using TCHAR so your buffer could be ASCII or Unicode. You should use the _T() macro around your strings, and the _countof() macro to specify the size thus:
C++
TCHAR wsa_error_text[ 16 ];
...
_stprintf_s( wsa_error_text, _countof(wsa_error_text),  _T("%d"), wsa_error_code );


Alternatively make your project all ASCII or all Unicode.
One of these days I'm going to think of a really clever signature.

GeneralRe: get a number into static text control Pin
bkelly1315-Sep-12 5:14
bkelly1315-Sep-12 5:14 
GeneralRe: get a number into static text control Pin
Richard MacCutchan15-Sep-12 5:42
mveRichard MacCutchan15-Sep-12 5:42 
QuestionMirroring system imagelist Pin
Huzifa Terkawi11-Sep-12 15:27
Huzifa Terkawi11-Sep-12 15:27 
QuestionCAsyncSocket, first application Pin
bkelly139-Sep-12 5:26
bkelly139-Sep-12 5:26 
AnswerRe: CAsyncSocket, first application Pin
Paul M Watt14-Sep-12 15:47
mentorPaul M Watt14-Sep-12 15:47 
QuestionAfxGetThread vs GetCurrentThreadID Pin
kishorekumarnaik6-Sep-12 6:52
kishorekumarnaik6-Sep-12 6:52 
AnswerRe: AfxGetThread vs GetCurrentThreadID Pin
Jiří Miklík7-Sep-12 0:24
Jiří Miklík7-Sep-12 0:24 
Questionerror C2039: 'abort' : is not a member of 'std' Pin
KASR12-Sep-12 23:35
KASR12-Sep-12 23:35 
AnswerRe: error C2039: 'abort' : is not a member of 'std' Pin
Richard MacCutchan3-Sep-12 0:50
mveRichard MacCutchan3-Sep-12 0:50 
GeneralRe: error C2039: 'abort' : is not a member of 'std' Pin
KASR13-Sep-12 1:44
KASR13-Sep-12 1:44 
GeneralRe: error C2039: 'abort' : is not a member of 'std' Pin
Richard MacCutchan3-Sep-12 2:21
mveRichard MacCutchan3-Sep-12 2:21 
AnswerRe: error C2039: 'abort' : is not a member of 'std' Pin
Stephen Hewitt3-Sep-12 16:54
Stephen Hewitt3-Sep-12 16:54 
GeneralRe: error C2039: 'abort' : is not a member of 'std' Pin
KASR13-Sep-12 19:46
KASR13-Sep-12 19:46 
GeneralRe: error C2039: 'abort' : is not a member of 'std' Pin
Richard MacCutchan3-Sep-12 22:18
mveRichard MacCutchan3-Sep-12 22:18 
GeneralRe: error C2039: 'abort' : is not a member of 'std' Pin
KASR13-Sep-12 22:29
KASR13-Sep-12 22:29 
GeneralRe: error C2039: 'abort' : is not a member of 'std' Pin
Richard MacCutchan3-Sep-12 23:23
mveRichard MacCutchan3-Sep-12 23:23 
GeneralRe: error C2039: 'abort' : is not a member of 'std' Pin
KASR14-Sep-12 2:36
KASR14-Sep-12 2:36 

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.