Click here to Skip to main content
15,907,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: wstring to LPCTSTR Pin
kakan15-Nov-05 0:07
professionalkakan15-Nov-05 0:07 
GeneralRe: wstring to LPCTSTR Pin
Luke Murray15-Nov-05 12:44
Luke Murray15-Nov-05 12:44 
AnswerRe: wstring to LPCTSTR Pin
22491715-Nov-05 1:56
22491715-Nov-05 1:56 
GeneralRe: wstring to LPCTSTR Pin
sunit515-Nov-05 2:21
sunit515-Nov-05 2:21 
GeneralRe: wstring to LPCTSTR Pin
toxcct15-Nov-05 2:43
toxcct15-Nov-05 2:43 
GeneralRe: wstring to LPCTSTR Pin
22491715-Nov-05 5:44
22491715-Nov-05 5:44 
GeneralRe: wstring to LPCTSTR Pin
Luke Murray15-Nov-05 12:42
Luke Murray15-Nov-05 12:42 
GeneralRe: wstring to LPCTSTR Pin
22491715-Nov-05 17:16
22491715-Nov-05 17:16 
WNDCLASSEX.lpszMenuName = getSomething().c_str();

in the above line wstring returned is destroyed as soon as the execution passes to the next line. So the pointer to the wstring is invalid after that. But the WNDCLASSEX unaware of this still try to access this pointer.

Also from the function getSomething()use the following syntax to return:
return wstring(L"my wstring");



suhredayan
There is no spoon.

GeneralRe: wstring to LPCTSTR Pin
sunit515-Nov-05 19:03
sunit515-Nov-05 19:03 
GeneralRe: wstring to LPCTSTR Pin
Luke Murray15-Nov-05 20:41
Luke Murray15-Nov-05 20:41 
Questionstruct inadvertantly calling stdafx.h function Pin
newbie534514-Nov-05 22:45
newbie534514-Nov-05 22:45 
AnswerRe: struct inadvertantly calling stdafx.h function Pin
jhwurmbach14-Nov-05 23:16
jhwurmbach14-Nov-05 23:16 
GeneralRe: struct inadvertantly calling stdafx.h function Pin
newbie534514-Nov-05 23:37
newbie534514-Nov-05 23:37 
GeneralRe: struct inadvertantly calling stdafx.h function Pin
jhwurmbach14-Nov-05 23:46
jhwurmbach14-Nov-05 23:46 
QuestionSaving before compiling Pin
Rage14-Nov-05 22:40
professionalRage14-Nov-05 22:40 
AnswerRe: Saving before compiling Pin
kakan14-Nov-05 22:46
professionalkakan14-Nov-05 22:46 
GeneralRe: Saving before compiling Pin
Rage14-Nov-05 23:55
professionalRage14-Nov-05 23:55 
QuestionMemory Leak In this function? Pin
szcococut14-Nov-05 22:01
szcococut14-Nov-05 22:01 
AnswerRe: Memory Leak In this function? Pin
Steen Krogsgaard14-Nov-05 23:31
Steen Krogsgaard14-Nov-05 23:31 
GeneralRe: Memory Leak In this function? Pin
szcococut15-Nov-05 2:43
szcococut15-Nov-05 2:43 
GeneralRe: Memory Leak In this function? Pin
toxcct15-Nov-05 2:47
toxcct15-Nov-05 2:47 
GeneralRe: Memory Leak In this function? Pin
szcococut15-Nov-05 2:51
szcococut15-Nov-05 2:51 
GeneralRe: Memory Leak In this function? Pin
toxcct15-Nov-05 3:00
toxcct15-Nov-05 3:00 
GeneralRe: Memory Leak In this function? Pin
Steen Krogsgaard15-Nov-05 3:16
Steen Krogsgaard15-Nov-05 3:16 
GeneralRe: Memory Leak In this function? Pin
szcococut15-Nov-05 3:23
szcococut15-Nov-05 3:23 

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.