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

C / C++ / MFC

 
GeneralRe: How can CString be converted to LPCTSTR without any operator()? Pin
Rajesh R Subramanian23-Jul-11 7:05
professionalRajesh R Subramanian23-Jul-11 7:05 
QuestionRe: How can CString be converted to LPCTSTR without any operator()? Pin
Dean Seo24-Jul-11 2:10
Dean Seo24-Jul-11 2:10 
AnswerRe: How can CString be converted to LPCTSTR without any operator()? Pin
Rajesh R Subramanian24-Jul-11 3:20
professionalRajesh R Subramanian24-Jul-11 3:20 
GeneralRe: How can CString be converted to LPCTSTR without any operator()? Pin
Dean Seo25-Jul-11 16:44
Dean Seo25-Jul-11 16:44 
QuestionAfxGetMainWnd() equals to AfxGetMainWnd ? Pin
yu-jian21-Jul-11 16:24
yu-jian21-Jul-11 16:24 
AnswerRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
Mark Salsbery21-Jul-11 17:06
Mark Salsbery21-Jul-11 17:06 
GeneralRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
yu-jian25-Jul-11 4:16
yu-jian25-Jul-11 4:16 
AnswerRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
Richard MacCutchan21-Jul-11 22:05
mveRichard MacCutchan21-Jul-11 22:05 
As you can see here[^] AfxGetMainWnd() returns a CWnd* i.e. a pointer to a CWnd object. In your call you actually want a pointer to your CMainFrame object, so you have to use the cast to let the compiler know that the return value will actually be a pointer to a different object type than described in the function definition. Remember also that you can only cast to an object that derives from the original, and since CMainFrame derives from CWnd this will work OK.
The best things in life are not things.

AnswerRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
Stefan_Lang22-Jul-11 0:20
Stefan_Lang22-Jul-11 0:20 
JokeRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
«_Superman_»22-Jul-11 2:30
professional«_Superman_»22-Jul-11 2:30 
GeneralRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
Richard MacCutchan22-Jul-11 4:18
mveRichard MacCutchan22-Jul-11 4:18 
GeneralRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
«_Superman_»22-Jul-11 6:03
professional«_Superman_»22-Jul-11 6:03 
GeneralRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
Richard MacCutchan22-Jul-11 22:58
mveRichard MacCutchan22-Jul-11 22:58 
GeneralRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
«_Superman_»23-Jul-11 4:01
professional«_Superman_»23-Jul-11 4:01 
GeneralRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
Richard MacCutchan23-Jul-11 4:25
mveRichard MacCutchan23-Jul-11 4:25 
QuestionRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
David Crow22-Jul-11 6:03
David Crow22-Jul-11 6:03 
JokeRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
«_Superman_»22-Jul-11 9:28
professional«_Superman_»22-Jul-11 9:28 
GeneralRe: AfxGetMainWnd() equals to AfxGetMainWnd ? Pin
yu-jian25-Jul-11 4:20
yu-jian25-Jul-11 4:20 
QuestionQUERY: How to control external exe & read it's process details Pin
andwan021-Jul-11 5:16
andwan021-Jul-11 5:16 
AnswerRe: QUERY: How to control external exe & read it's process details Pin
Richard Andrew x6421-Jul-11 5:34
professionalRichard Andrew x6421-Jul-11 5:34 
AnswerRe: QUERY: How to control external exe & read it's process details Pin
Abhi Lahare21-Jul-11 5:38
Abhi Lahare21-Jul-11 5:38 
AnswerRe: QUERY: How to control external exe & read it's process details Pin
jschell21-Jul-11 8:50
jschell21-Jul-11 8:50 
AnswerRe: QUERY: How to control external exe & read it's process details Pin
«_Superman_»21-Jul-11 9:00
professional«_Superman_»21-Jul-11 9:00 
QuestionDoes "delete" operator work for PVOID pointers? Pin
Cold_Fearing_Bird21-Jul-11 2:36
Cold_Fearing_Bird21-Jul-11 2:36 
AnswerRe: Does "delete" operator work for PVOID pointers? Pin
Maximilien21-Jul-11 3:03
Maximilien21-Jul-11 3:03 

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.