Click here to Skip to main content
15,905,071 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: OnLButtonDblClk not working in CMainFrame Pin
«_Superman_»16-Jun-12 3:10
professional«_Superman_»16-Jun-12 3:10 
GeneralRe: OnLButtonDblClk not working in CMainFrame Pin
_Flaviu16-Jun-12 4:13
_Flaviu16-Jun-12 4:13 
GeneralRe: OnLButtonDblClk not working in CMainFrame Pin
«_Superman_»16-Jun-12 17:20
professional«_Superman_»16-Jun-12 17:20 
GeneralRe: OnLButtonDblClk not working in CMainFrame Pin
_Flaviu17-Jun-12 9:00
_Flaviu17-Jun-12 9:00 
GeneralRe: OnLButtonDblClk not working in CMainFrame Pin
_Flaviu17-Jun-12 19:38
_Flaviu17-Jun-12 19:38 
GeneralRe: OnLButtonDblClk not working in CMainFrame Pin
«_Superman_»17-Jun-12 19:46
professional«_Superman_»17-Jun-12 19:46 
AnswerRe: OnLButtonDblClk not working in CMainFrame Pin
Eugen Podsypalnikov17-Jun-12 20:28
Eugen Podsypalnikov17-Jun-12 20:28 
QuestionAdvantage Multicore over Multithread in core i7 Pin
shankha201015-Jun-12 21:53
shankha201015-Jun-12 21:53 
AnswerRe: Advantage Multicore over Multithread in core i7 - Repost Pin
Richard MacCutchan16-Jun-12 0:04
mveRichard MacCutchan16-Jun-12 0:04 
Questiondll application is not launching for some PCS Pin
appollosputnik15-Jun-12 2:34
appollosputnik15-Jun-12 2:34 
AnswerRe: dll application is not launching for some PCS Pin
Richard MacCutchan15-Jun-12 2:50
mveRichard MacCutchan15-Jun-12 2:50 
JokeRe: dll application is not launching for some PCS Pin
David Crow15-Jun-12 4:56
David Crow15-Jun-12 4:56 
GeneralRe: dll application is not launching for some PCS Pin
Richard MacCutchan15-Jun-12 5:09
mveRichard MacCutchan15-Jun-12 5:09 
QuestionProblem with writing values to Shared Memory Pin
manoharbalu15-Jun-12 0:59
manoharbalu15-Jun-12 0:59 
AnswerRe: Problem with writing values to Shared Memory Pin
Richard MacCutchan15-Jun-12 2:47
mveRichard MacCutchan15-Jun-12 2:47 
QuestionAdding checkboxes to the multiple columns of CListCtrl Pin
Ashish Ranjan Mishra15-Jun-12 0:24
Ashish Ranjan Mishra15-Jun-12 0:24 
AnswerRe: Adding checkboxes to the multiple columns of CListCtrl Pin
_AnsHUMAN_ 15-Jun-12 1:18
_AnsHUMAN_ 15-Jun-12 1:18 
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.

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.