Click here to Skip to main content
15,909,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC Programming Problem. Pin
kaushal kishore sharma11-Sep-08 9:23
kaushal kishore sharma11-Sep-08 9:23 
GeneralRe: MFC Programming Problem. Pin
Mark Salsbery11-Sep-08 9:29
Mark Salsbery11-Sep-08 9:29 
GeneralRe: MFC Programming Problem. Pin
kaushal kishore sharma11-Sep-08 9:32
kaushal kishore sharma11-Sep-08 9:32 
GeneralRe: MFC Programming Problem. Pin
David Crow11-Sep-08 10:21
David Crow11-Sep-08 10:21 
AnswerRe: MFC Programming Problem. Pin
followait11-Sep-08 15:15
followait11-Sep-08 15:15 
QuestionReading text from an activated view... Pin
PankajB11-Sep-08 5:52
PankajB11-Sep-08 5:52 
AnswerRe: Reading text from an activated view... Pin
enhzflep11-Sep-08 6:04
enhzflep11-Sep-08 6:04 
GeneralRe: Reading text from an activated view... Pin
James R. Twine11-Sep-08 8:51
James R. Twine11-Sep-08 8:51 
   Yikes...

   OK - generally, that will only take the caption if the target window is not an edit control.  For a complex view (e.g. CFormView-based views), you will have to descend into the child controls to get at the text-based ones.  Using Notepad as an example, you will likely only get Notepad's caption.

   You should mention that the above code will not work correctly in a Unicode build and is not TCHAR safe.  Also, you do not handle deallocation of the buffer.  You can skip the memset(...) by using calloc(...), but this is not necessary because you allocate enough space for the terminating NUL to be put in.

   Might want to use new instead because this is likely a C++ target.  (When you get older, you appreciate consistency more and more...)

   Peace!

-=- James
Please rate this message - let me know if I helped or not!<hr></hr>If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong!
Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road!
See DeleteFXPFiles



GeneralRe: Reading text from an activated view... Pin
enhzflep11-Sep-08 15:30
enhzflep11-Sep-08 15:30 
GeneralRe: Reading text from an activated view... Pin
PankajB11-Sep-08 17:22
PankajB11-Sep-08 17:22 
GeneralRe: Reading text from an activated view... Pin
PankajB11-Sep-08 18:01
PankajB11-Sep-08 18:01 
GeneralRe: Reading text from an activated view... Pin
enhzflep11-Sep-08 23:07
enhzflep11-Sep-08 23:07 
GeneralRe: Reading text from an activated view... Pin
PankajB11-Sep-08 23:54
PankajB11-Sep-08 23:54 
GeneralRe: Reading text from an activated view... Pin
James R. Twine12-Sep-08 7:52
James R. Twine12-Sep-08 7:52 
GeneralRe: Reading text from an activated view... Pin
PankajB14-Sep-08 19:38
PankajB14-Sep-08 19:38 
QuestionBasic MFC SDI question Pin
Klive811-Sep-08 4:30
Klive811-Sep-08 4:30 
AnswerRe: Basic MFC SDI question Pin
Mark Salsbery11-Sep-08 5:35
Mark Salsbery11-Sep-08 5:35 
QuestionRe: Basic MFC SDI question Pin
led mike11-Sep-08 5:39
led mike11-Sep-08 5:39 
AnswerOT Pin
CPallini11-Sep-08 5:46
mveCPallini11-Sep-08 5:46 
AnswerRe: Basic MFC SDI question Pin
Mark Salsbery11-Sep-08 6:02
Mark Salsbery11-Sep-08 6:02 
AnswerRe: Basic MFC SDI question Pin
CPallini11-Sep-08 5:45
mveCPallini11-Sep-08 5:45 
AnswerRe: Basic MFC SDI question Pin
bob1697211-Sep-08 6:38
bob1697211-Sep-08 6:38 
Questionhow to get visual c++ to restore open files? Pin
Sauce!11-Sep-08 3:24
Sauce!11-Sep-08 3:24 
AnswerRe: how to get visual c++ to restore open files? Pin
Sauce!13-Sep-08 17:11
Sauce!13-Sep-08 17:11 
QuestionWrite a COM object used by asp app the first time, need help Pin
followait11-Sep-08 2:29
followait11-Sep-08 2:29 

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.