Click here to Skip to main content
15,915,160 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Simple mp3 playback? Pin
Christian Graus20-Jan-02 11:59
protectorChristian Graus20-Jan-02 11:59 
GeneralI saw that but... Pin
20-Jan-02 12:14
suss20-Jan-02 12:14 
GeneralGetting MFC controls Pin
Steve Severance20-Jan-02 7:28
Steve Severance20-Jan-02 7:28 
GeneralRe: Getting MFC controls Pin
Ravi Bhavnani20-Jan-02 11:25
professionalRavi Bhavnani20-Jan-02 11:25 
GeneralRe: Getting MFC controls Pin
Steve Severance20-Jan-02 14:36
Steve Severance20-Jan-02 14:36 
GeneralRe: Getting MFC controls Pin
Ravi Bhavnani21-Jan-02 1:37
professionalRavi Bhavnani21-Jan-02 1:37 
GeneralRe: Getting MFC controls Pin
Jay Beckert20-Jan-02 16:56
Jay Beckert20-Jan-02 16:56 
GeneralRe: Getting MFC controls Pin
Roger Allen21-Jan-02 2:26
Roger Allen21-Jan-02 2:26 
GetDlgItem() which returns a CWnd* pointer is an override of the API call

::GetDlgItem(HWND hwnd, UINT control_id) ;


For it to work, you need to have the handle (HWND) of the controls parent window (after all, your getting a dialog item).

It would work for a formview as it is the parent window. If you need to do it from some place else, you would need to get a pointer to the formview first. Something like:

// if you had a pointer to your doc object
POSITION pos = pDoc->GetFirstViewPosition() ;
CView* pView = pDoc->GetNextView(pos) ;

pView->GetDlgItem(control_id)....


If you were doing this from a worker thread, i have in the past, given it a pointer to the doc whos data it works on, and from there get a pointer to the view (as above) when I needed to update a control. I haven't paid any particular attention to how thread safe it is, but have yet to encounter any problems in this regard.




Roger Allen
Sonork 100.10016

If I'm not breathing, I'm either dead or holding my breath.
GeneralRe: Getting MFC controls Pin
Anna-Jayne Metcalfe21-Jan-02 4:09
Anna-Jayne Metcalfe21-Jan-02 4:09 
GeneralReport Pin
Drawil20-Jan-02 7:16
Drawil20-Jan-02 7:16 
GeneralRe: Report Pin
Bernhard20-Jan-02 19:27
Bernhard20-Jan-02 19:27 
GeneralRe: Report Pin
Drawil21-Jan-02 0:39
Drawil21-Jan-02 0:39 
GeneralRe: Report Pin
Bernhard21-Jan-02 3:05
Bernhard21-Jan-02 3:05 
QuestionBold and regular text in CToolTipCtrl? Pin
User 665820-Jan-02 7:04
User 665820-Jan-02 7:04 
Questionselect * from table1 where field1= variable,why error? Pin
NowOKcom20-Jan-02 7:00
NowOKcom20-Jan-02 7:00 
AnswerRe: select * from table1 where field1= variable,why error? Pin
Christopher Lord20-Jan-02 12:38
Christopher Lord20-Jan-02 12:38 
GeneralNo separators on toolbars Pin
Jon Newman20-Jan-02 6:59
Jon Newman20-Jan-02 6:59 
Questionstr.Format(" with a qoute " in a string"); ??? Pin
Jay Beckert20-Jan-02 6:15
Jay Beckert20-Jan-02 6:15 
AnswerRe: str.Format(" with a qoute " in a string"); ??? Pin
Jay Beckert20-Jan-02 6:29
Jay Beckert20-Jan-02 6:29 
GeneralRe: str.Format(" with a qoute " in a string"); ??? Pin
User 665820-Jan-02 7:06
User 665820-Jan-02 7:06 
QuestionDrag'n'Drop to Explorer windows? Pin
Lofote20-Jan-02 4:37
Lofote20-Jan-02 4:37 
AnswerRe: Drag'n'Drop to Explorer windows? Pin
Michael Dunn20-Jan-02 6:56
sitebuilderMichael Dunn20-Jan-02 6:56 
GeneralBYTE concatenation and strcat() questions Pin
Kuniva20-Jan-02 3:28
Kuniva20-Jan-02 3:28 
GeneralRe: BYTE concatenation and strcat() questions Pin
Michael Dunn20-Jan-02 6:58
sitebuilderMichael Dunn20-Jan-02 6:58 
GeneralWin2000 Registry Problem Pin
John Clump20-Jan-02 2:02
John Clump20-Jan-02 2:02 

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.