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

C / C++ / MFC

 
AnswerRe: Adding checkboxes to the multiple columns of CListCtrl Pin
_Flaviu15-Jun-12 18:17
_Flaviu15-Jun-12 18:17 
QuestionDifference between goto and function calls Pin
CodingLover14-Jun-12 19:37
CodingLover14-Jun-12 19:37 
AnswerRe: Difference between goto and function calls Pin
Eugen Podsypalnikov14-Jun-12 20:31
Eugen Podsypalnikov14-Jun-12 20:31 
AnswerRe: Difference between goto and function calls Pin
Erudite_Eric14-Jun-12 20:51
Erudite_Eric14-Jun-12 20:51 
AnswerRe: Difference between goto and function calls Pin
Richard MacCutchan14-Jun-12 21:53
mveRichard MacCutchan14-Jun-12 21:53 
GeneralRe: Difference between goto and function calls Pin
Erudite_Eric15-Jun-12 21:40
Erudite_Eric15-Jun-12 21:40 
GeneralRe: Difference between goto and function calls Pin
Richard MacCutchan15-Jun-12 22:29
mveRichard MacCutchan15-Jun-12 22:29 
GeneralBug in ATL/MFC 8.0 CString Pin
XmlSeeker14-Jun-12 19:19
XmlSeeker14-Jun-12 19:19 
I think I have found a bug in the CString assignement operator of the ATL/MFC 8.
C++
CStringT& operator=( __in_z_opt PCYSTR pszSrc )

The method calculates the length of the required buffer and allocates the buffer. The calculation does not include the terminating null character. Thereafter it calls MultiByteToWideChar, passing the length as the cchWideChar parameter.

The function MultiByteToWideChar returns 0 as failure indication, but this is ignored by the MFC. As a side effect, MultiByteToWideChar fills the output buffer on some platforms like Win32 and Windows CE 5.0 (SH4).

But the Windows CE 5.0 (x86) implementation of MultiByteToWideChar does not fill the buffer. Although the allocated buffer is too small, the bug is not visible on most platforms but on Windows CE 5.0 (x86). Here you get an empty CString after the assignment.

Example:
C++
CStringW s("ABC");
PCWSTR p = (PCWSTR)s;
assert(0 != p[0]); The assert in the code above fails.

GeneralRe: Bug in ATL/MFC 8.0 CString Pin
Erudite_Eric14-Jun-12 20:54
Erudite_Eric14-Jun-12 20:54 
GeneralRe: Bug in ATL/MFC 8.0 CString Pin
Eugen Podsypalnikov14-Jun-12 20:59
Eugen Podsypalnikov14-Jun-12 20:59 
GeneralRe: Bug in ATL/MFC 8.0 CString Pin
XmlSeeker16-Jun-12 7:18
XmlSeeker16-Jun-12 7:18 
QuestionError with dynamic_cast Pin
msr_codeproject12-Jun-12 20:14
msr_codeproject12-Jun-12 20:14 
AnswerRe: Error with dynamic_cast Pin
Richard MacCutchan12-Jun-12 21:59
mveRichard MacCutchan12-Jun-12 21:59 
GeneralRe: Error with dynamic_cast Pin
msr_codeproject12-Jun-12 22:47
msr_codeproject12-Jun-12 22:47 
AnswerRe: Error with dynamic_cast Pin
Erudite_Eric13-Jun-12 5:35
Erudite_Eric13-Jun-12 5:35 
AnswerRe: Error with dynamic_cast Pin
Iain Clarke, Warrior Programmer14-Jun-12 2:33
Iain Clarke, Warrior Programmer14-Jun-12 2:33 
GeneralRe: Error with dynamic_cast Pin
Richard MacCutchan14-Jun-12 4:10
mveRichard MacCutchan14-Jun-12 4:10 
GeneralRe: Error with dynamic_cast Pin
Iain Clarke, Warrior Programmer14-Jun-12 4:11
Iain Clarke, Warrior Programmer14-Jun-12 4:11 
GeneralRe: Error with dynamic_cast Pin
Richard MacCutchan14-Jun-12 4:23
mveRichard MacCutchan14-Jun-12 4:23 
QuestionGoogle Docs API Pin
.dan.g.12-Jun-12 17:54
professional.dan.g.12-Jun-12 17:54 
AnswerRe: Google Docs API Pin
Albert Holguin12-Jun-12 18:32
professionalAlbert Holguin12-Jun-12 18:32 
GeneralRe: Google Docs API Pin
.dan.g.13-Jun-12 18:11
professional.dan.g.13-Jun-12 18:11 
QuestionPorting MFC exe to ATL service and MFC GUI Pin
es196812-Jun-12 3:51
es196812-Jun-12 3:51 
QuestionAudio Encryption Pin
AmbiguousName11-Jun-12 20:15
AmbiguousName11-Jun-12 20:15 
AnswerRe: Audio Encryption Pin
Richard MacCutchan11-Jun-12 22:13
mveRichard MacCutchan11-Jun-12 22:13 

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.