Click here to Skip to main content
15,898,374 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Abstract Base classes vs Interfaces Pin
toxcct15-Nov-05 1:02
toxcct15-Nov-05 1:02 
AnswerRe: Abstract Base classes vs Interfaces Pin
LogiPro10125-Jan-09 11:32
LogiPro10125-Jan-09 11:32 
QuestionBuiding dll with Visual Studio 2003 Pin
Emb_Emb14-Nov-05 23:42
Emb_Emb14-Nov-05 23:42 
QuestionEasy installation of printer drivers Pin
Palani Surendrnath14-Nov-05 23:40
Palani Surendrnath14-Nov-05 23:40 
AnswerRe: Easy installation of printer drivers Pin
toxcct15-Nov-05 0:13
toxcct15-Nov-05 0:13 
QuestionActiveX control without parent container Pin
Ahsan Askare14-Nov-05 23:35
Ahsan Askare14-Nov-05 23:35 
QuestionEasy installation of printer drivers Pin
Palani Surendrnath14-Nov-05 23:23
Palani Surendrnath14-Nov-05 23:23 
Questionwstring to LPCTSTR Pin
Luke Murray14-Nov-05 22:54
Luke Murray14-Nov-05 22:54 
Hey all.

I had a function that simply returned a LPCTSTR like

LPCTSTR getSomething() { return L"Hello There"; }

Using that in GetClassInfoEx, CreateWindowEx, etc worked fine. Though I tried to change it to a wstring like so

wstring getSomething() { return L"Hello There"; } or
const wstring getSomething() { return L"Hello There"; }

both compiled etc, though I always got memory access errors. I am just wondering why this is so, and what I can do to get around it. Mainly WNDCLASSEX.lpszMenuName = getSomething().c_str() would fall over.

Any ideas on how to do this correctlly? I did try casting it as a LPCTSTR as well with no luck.

Thanks all
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 
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 

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.