Thread View: comp.os.ms-windows.programmer.tools.mfc
4 messages
4 total messages
Started by andrew oxenburgh
Sun, 07 Apr 1996 09:29
Re: Controls in non-dialog (mfc)
Author: andrew oxenburgh
Date: Sun, 07 Apr 1996 09:29
Date: Sun, 07 Apr 1996 09:29
17 lines
957 bytes
957 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? 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 > Steve, I'm an OWL programmer, not an MFC Programmer, but I'd say you also have to Show(SW_SHOW) to the CEdit. ???
Re: Controls in non-dialog (mfc)
Author: Richard Clarke
Date: Wed, 10 Apr 1996 18:58
Date: Wed, 10 Apr 1996 18:58
27 lines
1388 bytes
1388 bytes
In article <4k81um$s8t@pub.news.uk.psi.net>, andrew oxenburgh <andrew.ox enburgh@private.nethead.co.uk> writes >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? 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 >> > > >Steve, I'm an OWL programmer, not an MFC Programmer, but I'd say >you also have to Show(SW_SHOW) to the CEdit. ??? Why not try the CFormView class? This is based on a dialog template, very nice and simple to use. Good luck -- Richard Clarke
Re: Controls in non-dialog (mfc)
Author: Angel E. Brisighelli
Date: Wed, 10 Apr 1996 22:10
Date: Wed, 10 Apr 1996 22:10
27 lines
1478 bytes
1478 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? 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 >> I do this in some programs without problems. A stupid question. Do you put the WS_VISIBLE attribute in the Create() call, and pass the pointer at your View in the parent field ? chau -- //-------------------------------------------------------------------- // Angel E. Brisighelli Soft Data S.A. // abrisig@softdata.satlink.net Malabia 853 // Buenos Aires, Argentina Tel. (54) 1-777-0444 //-------------------------------------------------------------------- //
Re: Controls in non-dialog (mfc)
Author: William Heitler
Date: Mon, 15 Apr 1996 11:46
Date: Mon, 15 Apr 1996 11:46
49 lines
1784 bytes
1784 bytes
andrew oxenburgh wrote:
>
> 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? 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
> >
So far as I know the nID can be anything you like. To have it come up visible at the start don't
forget to set WS_VISIBLE in the Create.
I have:
in *.h
class CVertAxis : public CWnd // the containing class (could be from CView)
{
.
.
CEdit TopScale; // embedded edit control
.
.
// Generated message map functions
protected:
//{{AFX_MSG(CVertAxis)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
.
.
and in *.cpp
int CVertAxis::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
.
.
if (!TopScale.Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP|
ES_MULTILINE | ES_RIGHT, rect1, this, IDC_TOPSCALE))
{
TRACE("Failed to create TopScale in CVertAxis");
return -1;
}
.
.
Hope this helps.
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