From: Dhanya on
CFormview



Tom Serface wrote:

I was a little sad when they took out the printing mechanisms for new form
07-Nov-07

I was a little sad when they took out the printing mechanisms for new form
views, but it's obviously pretty easy to add back in. The views are
different, but you usually have to do some finessing of the output with any
kind of view.

Tom

"Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in message
news:3pk2j3127206kaicma93lfbqkue92r0bp7(a)4ax.com...

Previous Posts In This Thread:

On Tuesday, November 06, 2007 7:55 AM
cNetWork wrote:

How can i a resource to an Document/view application?
Hello,
i am trying to add an dialog to Document/View application? but i
cannt,
how can i attach the dialog to the Document? is there a way?

thanks

On Tuesday, November 06, 2007 8:26 AM
David Wilkinson wrote:

Re: How can i a resource to an Document/view application?
cNetWork wrote:

cNetwork:

What does "attach the dialog to the Document" mean?

If you have added a dialog template in the resource editor, then you
must associate a CDialog-derived class with it. This class can be
instanciated and displayed anywhere in your code (provided you #include
the dialog header).

--
David Wilkinson
Visual C++ MVP

On Tuesday, November 06, 2007 8:36 AM
Joseph M. Newcomer wrote:

Go into the resource editor. Create a dialog.
Go into the resource editor. Create a dialog. Add a class to represent the dialog, for
example, CMyDialog. To call the dialog,
CMyDialog dlg;
dlg.DoModal();
There is no concept of "attaching" a dialog to anything, let alone a document.
joe

On Tue, 06 Nov 2007 12:55:48 -0000, cNetWork <halmuratov(a)gmail.com> wrote:

Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

On Tuesday, November 06, 2007 8:40 AM
cNetWork wrote:

Re: How can i a resource to an Document/view application?
Hello,
by default, I want My dialog to be displayed in the place of hte view,
i never done it before, that is why i used the word "attach",

is it possible to do it?

thanks

On Tuesday, November 06, 2007 8:47 AM
Scott McPhillips [MVP] wrote:

Re: How can i a resource to an Document/view application?
"cNetWork" <halmuratov(a)gmail.com> wrote in message
news:1194356406.591651.30530(a)z9g2000hsf.googlegroups.com...


CFormView is a view that displays a dialog template. In a new doc/view
project you simply change the view base class to CFormView in the final step
of the File/New wizard.

--
Scott McPhillips [VC++ MVP]

On Tuesday, November 06, 2007 8:54 AM
cNetWork wrote:

Re: How can i a resource to an Document/view application?
wrote:

Thanks, i just checked what u said, it works, but i am wonderng that
if my base class is CView, cannt i attach a dialog to The view?

On Tuesday, November 06, 2007 10:17 AM
AliR \(VC++ MVP\) wrote:

Re: How can i a resource to an Document/view application?
If you don't like CFormView maybe you can do this:

class CMyView : CView
{
private:
CMyDialog m_Dlg;
};

void CMyView::OnInitialUpdate()
{
CView::OnInitialUpdate();
m_Dlg.Create(CMyDialog::IDD,this);
}

BOOL CMyView::OnEraseBkgnd(...)
{
return TRUE;
}

void CMyView::OnSize(....)
{
if (m_Dlg.GetSafeHWnd() != NULL)
{
m_Dlg.SetWindowPos(NULL,0,0,CX,CY,SWP_NOZORDER);
}
}

AliR.

"cNetWork" <halmuratov(a)gmail.com> wrote in message
news:1194357272.440790.290480(a)o3g2000hsb.googlegroups.com...

On Tuesday, November 06, 2007 11:48 AM
Tom Serface wrote:

Re: How can i a resource to an Document/view application?
What's not to like about CFormView :o)

Tom

On Tuesday, November 06, 2007 1:35 PM
Scott McPhillips [MVP] wrote:

Re: How can i a resource to an Document/view application?
I am sure you can. But I am not sure what you mean by attach. You can
display a dialog from any function in any class. What more do you want?

--
Scott McPhillips [VC++ MVP]

On Tuesday, November 06, 2007 3:55 PM
Joseph M. Newcomer wrote:

That's a completely different question.
That's a completely different question. In that case, the question is "how can I make a
dialog be a view", which means you can use a CFormView-derived class. The simplest way to
do this is to create a new project, and when you get to the end, select the view type to
be CFormView. This will give you a blank dialog all set up to be a CFormView. It is a
bit harder to add it retroactively to an existing project, but the simplest way to do this
is to create a new, dummy project with a CFormView, and replace stuff in the original
project with the new stuff and do a bit of hand-editing. If you want multiple views, one
of which is a CFormView-derived class, then you would simply create a CFormView class, and
use the documented techniques for adding another view to a document.
joe

On Tue, 06 Nov 2007 13:40:06 -0000, cNetWork <halmuratov(a)gmail.com> wrote:

Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

On Tuesday, November 06, 2007 4:05 PM
AliR \(VC++ MVP\) wrote:

I know, most of my views are CFormViews.
I know, most of my views are CFormViews. But the OP did not seem to like
Scott's suggestion.

AliR.

On Tuesday, November 06, 2007 6:36 PM
Tom Serface wrote:

I think CFormView is one of the best things in MFC.
I think CFormView is one of the best things in MFC. It makes any form based
application look like a typical SDI or MDI application and gives it a lot of
features you wouldn't get in a normal dialog app (menu, toolbar,
document/view, etc.) I can't figure why people wouldn't want to use it over
a dialog, but at least, as you pointed out, it's possible :o)

Tom

"AliR (VC++ MVP)" <AliR(a)online.nospam> wrote in message
news:IG4Yi.53065$RX.11743(a)newssvr11.news.prodigy.net...

On Wednesday, November 07, 2007 12:56 AM
Joseph M. Newcomer wrote:

CFormView is a very, very, very nice feature. I've used them for years.
CFormView is a very, very, very nice feature. I've used them for years. Its major
problem is that it is poorly documented and not obvious as a good solution.
joe

On Tue, 6 Nov 2007 15:36:59 -0800, "Tom Serface" <tom.nospam(a)camaswood.com> wrote:

Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

On Wednesday, November 07, 2007 12:56 AM
Joseph M. Newcomer wrote:

I think you are confused.
I think you are confused. A CFormView is, guess what, a dialog attached to a view!
joe

On Tue, 06 Nov 2007 13:54:32 -0000, cNetWork <halmuratov(a)gmail.com> wrote:

Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

On Wednesday, November 07, 2007 11:39 AM
Tom Serface wrote:

I was a little sad when they took out the printing mechanisms for new form
I was a little sad when they took out the printing mechanisms for new form
views, but it's obviously pretty easy to add back in. The views are
different, but you usually have to do some finessing of the output with any
kind of view.

Tom

"Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in message
news:3pk2j3127206kaicma93lfbqkue92r0bp7(a)4ax.com...


Submitted via EggHeadCafe - Software Developer Portal of Choice
Create Hidden SharePoint List for Site Owners
http://www.eggheadcafe.com/tutorials/aspnet/585c3b6b-a727-4e73-a860-917a85a41b08/create-hidden-sharepoint.aspx
From: Tom Serface on
Is that a question? Yes I was referring to CFormView. Previous versions
had support for printing. It can be added back in by hand after the fact,
but it was taken out of the wizard created version several releases ago.

Tom

"Dhanya Gopinath" wrote in message news:2010211103155dhanyahere(a)gmail.com...
> CFormview
>
>
>
> Tom Serface wrote:
>
> I was a little sad when they took out the printing mechanisms for new form
> 07-Nov-07
>
> I was a little sad when they took out the printing mechanisms for new form
> views, but it's obviously pretty easy to add back in. The views are
> different, but you usually have to do some finessing of the output with
> any
> kind of view.
>
> Tom
>
> "Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in message
> news:3pk2j3127206kaicma93lfbqkue92r0bp7(a)4ax.com...
>
> Previous Posts In This Thread:
>
> On Tuesday, November 06, 2007 7:55 AM
> cNetWork wrote:
>
> How can i a resource to an Document/view application?
> Hello,
> i am trying to add an dialog to Document/View application? but i
> cannt,
> how can i attach the dialog to the Document? is there a way?
>
> thanks
>
> On Tuesday, November 06, 2007 8:26 AM
> David Wilkinson wrote:
>
> Re: How can i a resource to an Document/view application?
> cNetWork wrote:
>
> cNetwork:
>
> What does "attach the dialog to the Document" mean?
>
> If you have added a dialog template in the resource editor, then you
> must associate a CDialog-derived class with it. This class can be
> instanciated and displayed anywhere in your code (provided you #include
> the dialog header).
>
> --
> David Wilkinson
> Visual C++ MVP
>
> On Tuesday, November 06, 2007 8:36 AM
> Joseph M. Newcomer wrote:
>
> Go into the resource editor. Create a dialog.
> Go into the resource editor. Create a dialog. Add a class to represent
> the dialog, for
> example, CMyDialog. To call the dialog,
> CMyDialog dlg;
> dlg.DoModal();
> There is no concept of "attaching" a dialog to anything, let alone a
> document.
> joe
>
> On Tue, 06 Nov 2007 12:55:48 -0000, cNetWork <halmuratov(a)gmail.com> wrote:
>
> Joseph M. Newcomer [MVP]
> email: newcomer(a)flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm
>
> On Tuesday, November 06, 2007 8:40 AM
> cNetWork wrote:
>
> Re: How can i a resource to an Document/view application?
> Hello,
> by default, I want My dialog to be displayed in the place of hte view,
> i never done it before, that is why i used the word "attach",
>
> is it possible to do it?
>
> thanks
>
> On Tuesday, November 06, 2007 8:47 AM
> Scott McPhillips [MVP] wrote:
>
> Re: How can i a resource to an Document/view application?
> "cNetWork" <halmuratov(a)gmail.com> wrote in message
> news:1194356406.591651.30530(a)z9g2000hsf.googlegroups.com...
>
>
> CFormView is a view that displays a dialog template. In a new doc/view
> project you simply change the view base class to CFormView in the final
> step
> of the File/New wizard.
>
> --
> Scott McPhillips [VC++ MVP]
>
> On Tuesday, November 06, 2007 8:54 AM
> cNetWork wrote:
>
> Re: How can i a resource to an Document/view application?
> wrote:
>
> Thanks, i just checked what u said, it works, but i am wonderng that
> if my base class is CView, cannt i attach a dialog to The view?
>
> On Tuesday, November 06, 2007 10:17 AM
> AliR \(VC++ MVP\) wrote:
>
> Re: How can i a resource to an Document/view application?
> If you don't like CFormView maybe you can do this:
>
> class CMyView : CView
> {
> private:
> CMyDialog m_Dlg;
> };
>
> void CMyView::OnInitialUpdate()
> {
> CView::OnInitialUpdate();
> m_Dlg.Create(CMyDialog::IDD,this);
> }
>
> BOOL CMyView::OnEraseBkgnd(...)
> {
> return TRUE;
> }
>
> void CMyView::OnSize(....)
> {
> if (m_Dlg.GetSafeHWnd() != NULL)
> {
> m_Dlg.SetWindowPos(NULL,0,0,CX,CY,SWP_NOZORDER);
> }
> }
>
> AliR.
>
> "cNetWork" <halmuratov(a)gmail.com> wrote in message
> news:1194357272.440790.290480(a)o3g2000hsb.googlegroups.com...
>
> On Tuesday, November 06, 2007 11:48 AM
> Tom Serface wrote:
>
> Re: How can i a resource to an Document/view application?
> What's not to like about CFormView :o)
>
> Tom
>
> On Tuesday, November 06, 2007 1:35 PM
> Scott McPhillips [MVP] wrote:
>
> Re: How can i a resource to an Document/view application?
> I am sure you can. But I am not sure what you mean by attach. You can
> display a dialog from any function in any class. What more do you want?
>
> --
> Scott McPhillips [VC++ MVP]
>
> On Tuesday, November 06, 2007 3:55 PM
> Joseph M. Newcomer wrote:
>
> That's a completely different question.
> That's a completely different question. In that case, the question is
> "how can I make a
> dialog be a view", which means you can use a CFormView-derived class. The
> simplest way to
> do this is to create a new project, and when you get to the end, select
> the view type to
> be CFormView. This will give you a blank dialog all set up to be a
> CFormView. It is a
> bit harder to add it retroactively to an existing project, but the
> simplest way to do this
> is to create a new, dummy project with a CFormView, and replace stuff in
> the original
> project with the new stuff and do a bit of hand-editing. If you want
> multiple views, one
> of which is a CFormView-derived class, then you would simply create a
> CFormView class, and
> use the documented techniques for adding another view to a document.
> joe
>
> On Tue, 06 Nov 2007 13:40:06 -0000, cNetWork <halmuratov(a)gmail.com> wrote:
>
> Joseph M. Newcomer [MVP]
> email: newcomer(a)flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm
>
> On Tuesday, November 06, 2007 4:05 PM
> AliR \(VC++ MVP\) wrote:
>
> I know, most of my views are CFormViews.
> I know, most of my views are CFormViews. But the OP did not seem to like
> Scott's suggestion.
>
> AliR.
>
> On Tuesday, November 06, 2007 6:36 PM
> Tom Serface wrote:
>
> I think CFormView is one of the best things in MFC.
> I think CFormView is one of the best things in MFC. It makes any form
> based
> application look like a typical SDI or MDI application and gives it a lot
> of
> features you wouldn't get in a normal dialog app (menu, toolbar,
> document/view, etc.) I can't figure why people wouldn't want to use it
> over
> a dialog, but at least, as you pointed out, it's possible :o)
>
> Tom
>
> "AliR (VC++ MVP)" <AliR(a)online.nospam> wrote in message
> news:IG4Yi.53065$RX.11743(a)newssvr11.news.prodigy.net...
>
> On Wednesday, November 07, 2007 12:56 AM
> Joseph M. Newcomer wrote:
>
> CFormView is a very, very, very nice feature. I've used them for years.
> CFormView is a very, very, very nice feature. I've used them for years.
> Its major
> problem is that it is poorly documented and not obvious as a good
> solution.
> joe
>
> On Tue, 6 Nov 2007 15:36:59 -0800, "Tom Serface"
> <tom.nospam(a)camaswood.com> wrote:
>
> Joseph M. Newcomer [MVP]
> email: newcomer(a)flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm
>
> On Wednesday, November 07, 2007 12:56 AM
> Joseph M. Newcomer wrote:
>
> I think you are confused.
> I think you are confused. A CFormView is, guess what, a dialog attached
> to a view!
> joe
>
> On Tue, 06 Nov 2007 13:54:32 -0000, cNetWork <halmuratov(a)gmail.com> wrote:
>
> Joseph M. Newcomer [MVP]
> email: newcomer(a)flounder.com
> Web: http://www.flounder.com
> MVP Tips: http://www.flounder.com/mvp_tips.htm
>
> On Wednesday, November 07, 2007 11:39 AM
> Tom Serface wrote:
>
> I was a little sad when they took out the printing mechanisms for new form
> I was a little sad when they took out the printing mechanisms for new form
> views, but it's obviously pretty easy to add back in. The views are
> different, but you usually have to do some finessing of the output with
> any
> kind of view.
>
> Tom
>
> "Joseph M. Newcomer" <newcomer(a)flounder.com> wrote in message
> news:3pk2j3127206kaicma93lfbqkue92r0bp7(a)4ax.com...
>
>
> Submitted via EggHeadCafe - Software Developer Portal of Choice
> Create Hidden SharePoint List for Site Owners
> http://www.eggheadcafe.com/tutorials/aspnet/585c3b6b-a727-4e73-a860-917a85a41b08/create-hidden-sharepoint.aspx