Click here to Skip to main content
15,922,584 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CALLBACK Pin
Rickard Andersson2013-Mar-04 5:58
Rickard Andersson2013-Mar-04 5:58 
GeneralRe: CALLBACK Pin
Prakash Nadar13-Mar-04 14:11
Prakash Nadar13-Mar-04 14:11 
GeneralRe: CALLBACK Pin
Rickard Andersson2013-Mar-04 14:17
Rickard Andersson2013-Mar-04 14:17 
GeneralRe: CALLBACK Pin
Shi Zhu13-Mar-04 1:15
Shi Zhu13-Mar-04 1:15 
GeneralRe: CALLBACK Pin
Gary R. Wheeler13-Mar-04 5:45
Gary R. Wheeler13-Mar-04 5:45 
GeneralRe: CALLBACK Pin
Shi Zhu13-Mar-04 15:07
Shi Zhu13-Mar-04 15:07 
GeneralCFormView MDI App. Pin
nimrodel12-Mar-04 17:41
nimrodel12-Mar-04 17:41 
GeneralRe: CFormView MDI App. Pin
Antti Keskinen13-Mar-04 23:05
Antti Keskinen13-Mar-04 23:05 
Basically, in the class hiearchy, you have the main frame window. This owns the toolbar, the menu, and the child frame windows. Each child frame owns it's form view. So, if you need to issue a command that affects a form in the frames, you first need to obtain a pointer into the target view's class. Then use standard dialog commands to issue commands.

In order for this to work, you need pointers to the child frame windows. If you don't have them, you can enumerate through the childs of the main frame window by using GetTopWindow, then running a series of GetNextWindow calls along with a test to IsChild function. After you have all the pointers into the child frames, call GetActiveView through them to get the CView objects. Then cast down to CFormView, and voila, call the necessary functions.

You should also consider redesigning your application a bit if you don't have the pointers to the child windows. Enumerating through them is really troublesome. The easiest thing is to have pointers to the CFormView objects. You can always cast backwards or use GetParent to move back through the class hiearchy.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: CFormView MDI App. Pin
nimrodel14-Mar-04 21:39
nimrodel14-Mar-04 21:39 
Generalsquare-root project Pin
bishead12-Mar-04 17:12
bishead12-Mar-04 17:12 
GeneralRe: square-root project Pin
greba12-Mar-04 17:59
greba12-Mar-04 17:59 
GeneralRe: square-root project Pin
Roger Wright12-Mar-04 18:39
professionalRoger Wright12-Mar-04 18:39 
GeneralAbout MSChart Pin
junli12-Mar-04 15:49
junli12-Mar-04 15:49 
GeneralUsing File Streams with an MFC app Pin
Blue Pyre12-Mar-04 13:11
Blue Pyre12-Mar-04 13:11 
GeneralRe: Using File Streams with an MFC app Pin
Michael Dunn12-Mar-04 15:01
sitebuilderMichael Dunn12-Mar-04 15:01 
GeneralRe: Using File Streams with an MFC app Pin
l a u r e n12-Mar-04 20:25
l a u r e n12-Mar-04 20:25 
GeneralRe: Using File Streams with an MFC app Pin
Blue Pyre12-Mar-04 22:52
Blue Pyre12-Mar-04 22:52 
GeneralRe: Using File Streams with an MFC app Pin
Antti Keskinen13-Mar-04 23:09
Antti Keskinen13-Mar-04 23:09 
GeneralFTP and Ident Server :: Winsock Pin
valikac12-Mar-04 10:14
valikac12-Mar-04 10:14 
GeneralRe: FTP and Ident Server :: Winsock Pin
Rob Groves12-Mar-04 11:23
Rob Groves12-Mar-04 11:23 
GeneralRe: FTP and Ident Server :: Winsock Pin
valikac12-Mar-04 12:43
valikac12-Mar-04 12:43 
GeneralSend Print Job Pin
Anonymous12-Mar-04 9:22
Anonymous12-Mar-04 9:22 
GeneralRe: Send Print Job Pin
Rob Groves12-Mar-04 11:32
Rob Groves12-Mar-04 11:32 
Generaledit boxes linking Pin
Oriented12-Mar-04 9:05
Oriented12-Mar-04 9:05 
Generaledit boxes linking Pin
Oriented12-Mar-04 9:02
Oriented12-Mar-04 9: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.