Thread View: comp.os.ms-windows.programmer.tools.mfc
3 messages
3 total messages
Started by Steve Jones
Tue, 02 Apr 1996 20:29
Controls in non-dialog (mfc)
Author: Steve Jones
Date: Tue, 02 Apr 1996 20:29
Date: Tue, 02 Apr 1996 20:29
11 lines
738 bytes
738 bytes
How in MFC does one go about embedding a control within a window that is not a dialog box? For example, I can construct and Create() a CEdit object within a CView derived class, but nothing (apparently) happens. I knew when I tried it something wasn't quite right; I wasn't sure what to use for the nID. Is it necessary to use a resource? steve stevejones@ansys.com
Re: Controls in non-dialog (mfc)
Author: Blake Kadatz
Date: Tue, 09 Apr 1996 21:12
Date: Tue, 09 Apr 1996 21:12
21 lines
1536 bytes
1536 bytes
Steve Jones wrote: > > How in MFC does one go about embedding a control within a > window that is not a dialog box? For example, I can > construct and Create() a CEdit object within a CView derived > class, but nothing (apparently) happens. I knew when I > tried it something wasn't quite right; I wasn't sure what to > use for the nID. Is it necessary to use a resource? The simplest answer to this is of course to derive your view from CFormView, then (if you used AppWizard to generate your code) change around the MYAPP_FORM dialog template to add your CEdit control. Of course, if you really do need the CEdit control as a child of CView then you'll have to do a bit more hunting for this info. -- -------------------------------------------------------------------- Blake Kadatz phone: 604-420-3931 BitMotion Software Inc. fax: 604-420-3921 304 - 7321 Halifax Street mailto:blake_kadatz@mindlink.bc.ca Burnaby, B.C., Canada V5A 4R5
Re: Controls in non-dialog (mfc)
Author: James Moore
Date: Wed, 10 Apr 1996 18:49
Date: Wed, 10 Apr 1996 18:49
27 lines
1234 bytes
1234 bytes
sj2393@ansys.com (Steve Jones) writes: >How in MFC does one go about embedding a control within a >window that is not a dialog box? You're doing the right thing - you shouldn't have to do anything other than call Create (). Double-check a few things: 0. Is Create () returning TRUE? 1. Are you including WS_VISIBLE in your Create () call? 2. Make sure pParentWnd in the Create () call points to the right window. 3. Make sure the size rect is reasonable, and that the location of the control is inside the visible window. 4. Use Spy to see your window tree, which will include the new control. If it's going somewhere weird, this should help you find it. -- James Moore banshee@banshee.com http://www.seanet.com/Users/banshee/index.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads