Click here to Skip to main content
15,915,082 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Creating derived type from a base class template Pin
Skippums13-Mar-09 8:12
Skippums13-Mar-09 8:12 
GeneralRe: Creating derived type from a base class template Pin
Stuart Dootson13-Mar-09 14:02
professionalStuart Dootson13-Mar-09 14:02 
GeneralRe: Creating derived type from a base class template Pin
Skippums19-Mar-09 9:40
Skippums19-Mar-09 9:40 
QuestionMultiByteToWideChar crashes out on longer strings [modified] Pin
RichardBrock13-Mar-09 4:45
RichardBrock13-Mar-09 4:45 
AnswerRe: MultiByteToWideChar crashes out on longer strings Pin
led mike13-Mar-09 5:37
led mike13-Mar-09 5:37 
GeneralRe: MultiByteToWideChar crashes out on longer strings Pin
RichardBrock13-Mar-09 6:22
RichardBrock13-Mar-09 6:22 
QuestionRe: MultiByteToWideChar crashes out on longer strings Pin
led mike13-Mar-09 7:40
led mike13-Mar-09 7:40 
AnswerRe: MultiByteToWideChar crashes out on longer strings Pin
RichardBrock13-Mar-09 8:00
RichardBrock13-Mar-09 8:00 
The project outputs a 32 bit Windows executable (target platforms are XP and Vista), MFC linked is static.

I tried _tcslen as you suggested, same result. I'm testing from a live RSS feed, so the news item length has changed but here's the latest output from my outputdebugstring placed just after the 2nd MultiByteToWideChar call.

'return value = 140 (wcslen is 308) nSizeReq = 140 nBlockLength = 140'

so you can see the function call returns 140, the buffer allocated was 140 and the block length read from the file is 140. But the converted string is 308 in length, obviously overruning memory allocated to it.

Do you think compiler optimization could be causing a problem? I'm compiling with 'Enable link-time code generation (/GL)'.

Btw, a previous call for the preceding news item yields:

'return value = 121 (wcslen is 121) nSizeReq = 121 nBlockLength = 121'
GeneralRe: MultiByteToWideChar crashes out on longer strings Pin
led mike13-Mar-09 8:41
led mike13-Mar-09 8:41 
AnswerRe: MultiByteToWideChar crashes out on longer strings Pin
Akt_4_U13-Mar-09 5:39
Akt_4_U13-Mar-09 5:39 
GeneralRe: MultiByteToWideChar crashes out on longer strings Pin
RichardBrock13-Mar-09 6:26
RichardBrock13-Mar-09 6:26 
Questionget the font of my control and set it with an other (the face name) Pin
MrKBA13-Mar-09 4:26
MrKBA13-Mar-09 4:26 
AnswerRe: get the font of my control and set it with an other (the face name) Pin
Code-o-mat13-Mar-09 5:15
Code-o-mat13-Mar-09 5:15 
GeneralRe: get the font of my control and set it with an other (the face name) Pin
MrKBA13-Mar-09 5:30
MrKBA13-Mar-09 5:30 
GeneralRe: get the font of my control and set it with an other (the face name) Pin
Code-o-mat13-Mar-09 5:39
Code-o-mat13-Mar-09 5:39 
GeneralRe: get the font of my control and set it with an other (the face name) Pin
MrKBA13-Mar-09 5:47
MrKBA13-Mar-09 5:47 
GeneralRe: get the font of my control and set it with an other (the face name) Pin
Code-o-mat13-Mar-09 5:57
Code-o-mat13-Mar-09 5:57 
GeneralRe: get the font of my control and set it with an other (the face name) Pin
MrKBA13-Mar-09 6:29
MrKBA13-Mar-09 6:29 
QuestionRe: get the font of my control and set it with an other (the face name) Pin
led mike13-Mar-09 5:41
led mike13-Mar-09 5:41 
AnswerRe: get the font of my control and set it with an other (the face name) Pin
MrKBA13-Mar-09 5:51
MrKBA13-Mar-09 5:51 
AnswerRe: get the font of my control and set it with an other (the face name) Pin
Code-o-mat13-Mar-09 5:52
Code-o-mat13-Mar-09 5:52 
GeneralRe: get the font of my control and set it with an other (the face name) Pin
MrKBA13-Mar-09 6:17
MrKBA13-Mar-09 6:17 
GeneralRe: get the font of my control and set it with an other (the face name) Pin
Code-o-mat13-Mar-09 6:26
Code-o-mat13-Mar-09 6:26 
GeneralRe: get the font of my control and set it with an other (the face name) Pin
MrKBA13-Mar-09 6:33
MrKBA13-Mar-09 6:33 
QuestionError C1900 with static library Pin
Trollslayer13-Mar-09 4:19
mentorTrollslayer13-Mar-09 4:19 

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.