CView VS CDialog

Hello,

Can i create some CView on CDialog Object ??

How can i do it ??

thanks.


0
gbaudin2 (4)
10/13/2003 3:12:51 PM
vc.mfc 33608 articles. 0 followers. Follow

8 Replies
739 Views

Similar Articles

[PageSpeed] 16

"Ahryman40k" <gbaudin2@wanadoo.fr> wrote in message
news:bmefmd$3sv$1@news-reader5.wanadoo.fr...
> Hello,
>
> Can i create some CView on CDialog Object ??
>
> How can i do it ??
>
> thanks.

    I'm assuming you mean creating a view as a control on a dialog.  It can
be done with MFC 6.0, but Microsoft almost certainly doesn't support it and
you may find it can't be done in a later version of MFC.  Your view needs to
override OnMouseActivate so that it doesn't try to become the active view of
its parent frame when in a dialog.  You will need to create your view in the
OnInitDialog handler of your dialog.  You can get the rectangle for your
view by puting an invisible place holder control on your dialog and
retrieving its rectangle.  If you run into any other issues, feel free to
post a question.

                                        Nathan Holt


0
nathanh (83)
10/13/2003 3:56:36 PM
See this article:
http://www.microsoft.com/msj/0100/c/c0100.aspx

It shows how to create a dialog control derived from CHtmlView. I'm pretty
sure that can be done with other views too.

Hans



"Ahryman40k" <gbaudin2@wanadoo.fr> schrieb im Newsbeitrag
news:bmefmd$3sv$1@news-reader5.wanadoo.fr...
> Hello,
>
> Can i create some CView on CDialog Object ??
>
> How can i do it ??
>
> thanks.
>
>


0
hajue.ude (60)
10/13/2003 4:07:02 PM
Yes, it can be done, but you will be hardpressed to find a valid reason. Why would you
want to do this? If you want doc/view paradigm, you can use CFormView class which allows
dialog template based view.

--
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


"Ahryman40k" <gbaudin2@wanadoo.fr> wrote in message
news:bmefmd$3sv$1@news-reader5.wanadoo.fr...
| Hello,
|
| Can i create some CView on CDialog Object ??
|
| How can i do it ??
|
| thanks.
|
|

0
ajaykalra (6840)
10/14/2003 8:31:17 AM
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
news:Onh1$1ikDHA.3312@tk2msftngp13.phx.gbl...
> Yes, it can be done, but you will be hardpressed to find a valid reason.
Why would you
> want to do this? If you want doc/view paradigm, you can use CFormView
class which allows
> dialog template based view.
>
> --
> Ajay Kalra [MVP - VC++]
> ajaykalra@yahoo.com

    Hardpressed to find a valid reason?  What about a control that can
update itself in response to document changes?  It becomes much easier if
the control gets updated when the document calls UpdateAllViews.
    I am not sure by what you meant by Document/View architecture, but your
post implies that a view must be a child of the main frame or an MDI child
window.  Sometimes users want things on dialogs that display properties in
the document, and views are a natural choice for them.  A form view is NOT
the same thing.

                                        Nathan Holt


0
nathanh (83)
10/14/2003 7:30:30 PM
Doc/View is not directly supported in a Dialog app by MFC. The view portion of it is
loosely tied to the notion of CFrameWnd. If you want to take advantage of MFC's built-in
functionality, you should use SDI/MDI. I would like to know why do you think why
CFormView, which is built on the same dialog template as your dialog, not be same as a
dialog for your purpose. You dont need to have a toolbar/statusbar etc in a SDI/MDI
application.

-- 
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com


"Nathan Holt" <nathanh@ccei-nm.com> wrote in message news:bmhjci$ssi$1@reader2.nmix.net...
|
| "Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
| news:Onh1$1ikDHA.3312@tk2msftngp13.phx.gbl...
| > Yes, it can be done, but you will be hardpressed to find a valid reason.
| Why would you
| > want to do this? If you want doc/view paradigm, you can use CFormView
| class which allows
| > dialog template based view.
| >
| > --
| > Ajay Kalra [MVP - VC++]
| > ajaykalra@yahoo.com
|
|     Hardpressed to find a valid reason?  What about a control that can
| update itself in response to document changes?  It becomes much easier if
| the control gets updated when the document calls UpdateAllViews.
|     I am not sure by what you meant by Document/View architecture, but your
| post implies that a view must be a child of the main frame or an MDI child
| window.  Sometimes users want things on dialogs that display properties in
| the document, and views are a natural choice for them.  A form view is NOT
| the same thing.
|
|                                         Nathan Holt
|
|

0
ajaykalra (6840)
10/14/2003 9:57:00 PM
I think I've done what Ahryman40k is asking although I 
had to jump through a few hoops and possibly should have 
looked further into Ajay's suggestion of using a 
FormView...

I wanted to produce a property sheet with a splitter 
window on one page of the sheet. The splitter would hold 
tree and list views onto my document.

I derived CSplitFrame from CFrame. CSplitFrame contains 
an m_Splitter member. The OnCreateClient sets up the 
splitter window with its 2 views.

My property page class has a CSplitFrame* member variable 
(Constructed in the property page's constructor and never 
deleted: the framework handles deletion). In 
OnInitDialog, it calls the member variable's Create() 
function, passing in a pointer to the (previously 
created) document for it to attach to. You then have to 
call the members InitialUpdateFrame().

Because the document was created separately from and 
needed to last longer than the attached views, I also had 
to set its m_bAutoDelete member to false.

I hope this helps. Any feedback on better ways to do the 
job would be great.

--- Al.

>-----Original Message-----
>Yes, it can be done, but you will be hardpressed to find 
a valid reason. Why would you
>want to do this? If you want doc/view paradigm, you can 
use CFormView class which allows
>dialog template based view.
>
>--
>Ajay Kalra [MVP - VC++]
>ajaykalra@yahoo.com
>
>
>"Ahryman40k" <gbaudin2@wanadoo.fr> wrote in message
>news:bmefmd$3sv$1@news-reader5.wanadoo.fr...
>| Hello,
>|
>| Can i create some CView on CDialog Object ??
>|
>| How can i do it ??
>|
>| thanks.
>|
>|
>
>.
>
0
anonymous (74725)
10/15/2003 10:02:18 AM
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
news:ubijB4pkDHA.3024@tk2msftngp13.phx.gbl...
> Doc/View is not directly supported in a Dialog app by MFC. The view
portion of it is
> loosely tied to the notion of CFrameWnd. If you want to take advantage of
MFC's built-in
> functionality, you should use SDI/MDI. I would like to know why do you
think why
> CFormView, which is built on the same dialog template as your dialog, not
be same as a
> dialog for your purpose. You dont need to have a toolbar/statusbar etc in
a SDI/MDI
> application.
>
> -- 
> Ajay Kalra [MVP - VC++]
> ajaykalra@yahoo.com

    I am not the origonal poster, but I have had the same need.  A project
started out as an SDI project with multiple panes displaying live video
provided by the document, with the views displaying new frames in response
to UpdateAllViews.  A requirement was added that involved creating a popup
dialog that could display live video from the document as well.  I believe
it was quite a reasonable decision to put actual views of the document on
that dialog.  That's why I was a bit shocked at your "Hardpressed to find a
reason" statement.

                                        Nathan Holt


0
nathanh (83)
10/15/2003 3:15:58 PM



"Nathan Holt" <nathanh@ccei-nm.com> wrote in message news:bmjorf$39f$1@reader2.nmix.net...
|
| "Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
| news:ubijB4pkDHA.3024@tk2msftngp13.phx.gbl...
| > Doc/View is not directly supported in a Dialog app by MFC. The view
| portion of it is
| > loosely tied to the notion of CFrameWnd. If you want to take advantage of
| MFC's built-in
| > functionality, you should use SDI/MDI. I would like to know why do you
| think why
| > CFormView, which is built on the same dialog template as your dialog, not
| be same as a
| > dialog for your purpose. You dont need to have a toolbar/statusbar etc in
| a SDI/MDI
| > application.
| >
| > -- 
| > Ajay Kalra [MVP - VC++]
| > ajaykalra@yahoo.com
|
|     I am not the origonal poster, but I have had the same need.  A project
| started out as an SDI project with multiple panes displaying live video
| provided by the document, with the views displaying new frames in response
| to UpdateAllViews.  A requirement was added that involved creating a popup
| dialog that could display live video from the document as well.  I believe
| it was quite a reasonable decision to put actual views of the document on
| that dialog.  That's why I was a bit shocked at your "Hardpressed to find a
| reason" statement.

I see your reasoning. I would have approached it differently though. I may have gone with
MDI and popup a CFormView instead of dialog. (You can probably do this with SDI as well).
Putting Doc/View in a dialog does not make sense since you have a CFormView which does
essentially the same thing.

-- 
Ajay Kalra [MVP - VC++]
ajaykalra@yahoo.com

0
ajaykalra (6840)
10/15/2003 5:19:04 PM
Reply:

Similar Artilces:

Linking CRT and MFC libraries with VS 2005 SP1
Good day. I tried relinking CRT library and error occurrs during it. This error occcurrs due to -wx switch (warnings as errors). If this switch is erased, relinking is stopped due to *.obj is missing. I am beginner in nmake script syntax. Can you help me, please. Thank for your help. BEST regards Honza. I'm sure that if we saw what the error message was, we might have a clue as to what to say. Otherwise, your question is far too vague to answer. joe On Wed, 31 Jan 2007 12:38:27 +0100, "Hornik Jan" <NO_SPAM_hornik@elgas.cz_NOSPAM> wrote: >Good day. >I tr...

CView to CScrollView
I have an application view class that I derived from CView and now have discovered that it would be much better as CScrollView. Is there a relatively easy way to convert it or do I have to start over and do the cut-and-paste work??? Ron H. ----------------- www.Newsgroup-Binaries.com - *Completion*Retention*Speed* Access your favorite newsgroups from home or on the road ----------------- The usual technique is to create a CScrollView-derived class, copy the appropriate stuff out of it into your existing view, then remove the temporary CScrollView stuff from your project and delete the...

Full Item Count vs. Partial Item Count
I am trying to syncronize the inventory in my store with the counts in HQ. I have about 52000 items in my store. When I run a worksheet 501: Full Item Count, it runs for about a half-hour, then times out. I've tried bumping up the connection timeout interval, but no luck. Is there any way to perform a partial item count, so it only uploads the counts for a certain department or category? That is what I really need anyway (quantities for two categories are messed up, about 4500 items out of 52000). I have some SQL scripts that will syncronize the store ops and HQ data, but I want so...

How to write into CView?
m_hwndRenderWindow = GetDlgItem(IDC_RENDERVIEW)->GetSafeHwnd(); My application looks like the above except that I'm not drawing into the IDC_RENDERVIEW from a formview. I draw directly to CView... What is the corresponding call if I do so? Thanks Jack "Jack" <jl@knight.com> wrote in message news:ulIMAjwAIHA.5868@TK2MSFTNGP05.phx.gbl... > m_hwndRenderWindow = GetDlgItem(IDC_RENDERVIEW)->GetSafeHwnd(); > > > My application looks like the above except that I'm not drawing into the > IDC_RENDERVIEW from a formview. > I draw directly t...

Unicode vs ANSI Windows
Is there a way of determining if a window was created using CreateWindow(Ex)A or CreateWindow(Ex)W? I understand that IsWindowUnicode returns TRUE if the window class was registered with RegisterClass(Ex)W, but this is not what i am after. Thanks Mike Jackson I guess no, because on NT series CreateWindow(Ex)A internally calls CreateWindow(Ex)W and on 9x's vice-versa. Why you care? -- Thanks, Ara, 0xLLC "Mike Jackson" <michaelj@lennox.com.au> wrote in message news:uY1dRVBLEHA.3012@tk2msftngp13.phx.gbl... > Is there a way of determining if a window was created usi...

Mailbox Rights vs Mailbox Permissions
Hi, Can anybody tell me the difference between mailbox rights I can set in Active Directory and Mailbox permissions I can set in Outlook. Are they related?? Thanks for your answer, Dani <thud> Start here: http://www.microsoft.com/technet/prodtechnol/exchange/guides/StrPermwE2k3/770b3f6d-9e32-45a0-9b70-843f72f445ed.mspx More than you ever want to know, but important nonetheless. On 2 Mar 2005 05:56:20 -0800, ds215588@yahoo.com wrote: >Hi, > >Can anybody tell me the difference between mailbox rights I can set in >Active Directory and Mailbox permissions I can set in ...

propertypage from CView
Hi, I want to create a propertysheet on Cview. Following the steps from msdn really doesn't show the sheet. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_using_property_sheets_in_your_application.asp cause in step 3, it presumes it is based on a dialog. but mine is on CView. I put the code to create a sheet in CMyView::OnInitialUpdate CMyView::OnInitialUpdate(....) { sheet = new CPropertySheet(); page1 = new CMyPropertyPage(); page2 = new CMyPropertyPage(); sheet->AddPage(page1); sheet->AddPage(page2); sheet->Create(); } The above co...

XP vs Vista
Curruntly I own one station(rms2.0) window xp and SQL 2000 special addition because my data already cross 4gb. Now I am planing to ad second station in my store. Can I run one station xp and new one Vista or I have to have both window xp. Do I need to upgrade sql server. I need more help before I buy second station. Harjit, I got for a test an XP (virtual) and a Vista system with R.M.S. SO. With a database on a SQL2000 instance on the XP system. The Vista and XP system worked both fine and fast, so that is no problem. The only thing that could be a problem is drivers for your hardwa...

RPC over HTTP vs MAPI Overhead
How do the overhead of the two technologies (RPC over HTTP and MAPI) compare? Obviously you build in IIS overhead on the server, but strictly network preformance. Is the exact same data used in MAPI just wrapped in HTTP when using RPC over HTTP, or is it different somehow? If it's the same content, then obviously MAPI will be faster... again, not taking into account IIS overhead on the server... -Chris On 14 Jun 2005 03:25:10 -0700, ee99ee@gmail.com wrote: >How do the overhead of the two technologies (RPC over HTTP and MAPI) >compare? Obviously you build in IIS overhead on the se...

Current Yield vs. Yield to Maturity at low prices
When comparing Current Yield to YTM (as calculated from the Excel Yield () function), there are instances when Current Yield > YTM for discounted bonds. I can't seem to make sense of this. For example, the Current Yield for a $100 par-valued bond, with a 10% rate, and price of 1 is 10. But using the function Yield(11/1/09, 11/1/11, 10%, 1, 100, 4) gives a YTM of 9.35 I notice this is only happening with extremely low-priced bonds. I don't think there would ever be an instance when YTM < Current Yield, except for bonds purchased at a premium, so could this is a prob...

Trying to alter filegroup to READONLY from with VS
I'm using VS 2008 and SQL Server 2008 with all the latest updates. From within VB, I'm trying to issue a command to change a filegroup to READWRITE status. I make sure the connection on the DB I'm using is closed, and then I run the following code. dbNameStr is the name of the DB I currently using, and cnStr is the connection string to the DB named dbNameStr. cn.Close cn.ConnectionString = Replace(cnStr, dbNameStr, "master") SQL_cmd.CommandText = "USE master; ALTER DATABASE [" & dbNameStr & "] MODIFY FILEGROUP [Archive] READ_WRI...

Derived Class from CView : LNK2001
Dear all I'm trying to derive a class from CView. So I used the (VC++6) "MFC AppWizard (exe)" and selected a CView SDI Application. It works (no surprise). No I replaced all occurences of CView by CEditHLView -- snip CEditHLView.h -- #ifndef CEDIT_HL_VIEW_H #define CEDIT_HL_VIEW_H #include "stdafx.h" #include "afxwin.h" class CEditHLView : public CView { DECLARE_DYNCREATE(CEditHLView) public: CEditHLView() : CView() {}; ~CEditHLView() {}; }; #endif /* #define CEDIT_HL_VIEW_H */ -- snap -- If I now try to compile, I get the following error: thi...

XML DOM vs. IE DOM
I want to reference my XML DOM the same as in IE. I want to say dim strTitle as string = xmlnodereader.element['books'].attribute['title'].value = "The Autobiography of Benjamin Franklin" This has to be possible, help is appreciated, thanks. ----------------------------test.html <script> function doit() { alert(document.forms['form1'].elements['hitme'].name); } </script> <form name = form1> <input name = 'hitme' type=button value = 'hitme' onclick="doit()"</input> </form> ------------...

Pub vs Word
Our group sends an 8 page newsletter consisting of articles and photos. We do it in Publisher 2000. We have been advised by a computer expert that we should do it in Word - 1) so that it can be emailed to those of our members with internet access and, 2) that we would have more room for articles, without boxes taking up space. I thought Publisher was expressly for such publications and had advantages over Word for layout etc. Should we change to Word? Can the newsletter be converted to Word when finished for those members with email and Word? After managing to set up OE-QuoteFix on ...

Browser vs. Outlook
My turn to pick your brains. We have a Siebel client that we are going to move to MSCRM. Most of the desktop pc's are running win98 and they are not scheduled to be replaced anytime soon. So assume that all users will use the web client to access MSCRM. Since we don't have the ability to promote e-mail in the web client, it appears to me that the only option is to force all e-mail into CRM as activities. Can you think of any other possibilities? Thanks, Brian Outlook 2000/2002(XP) will run on Win98. Mike "Brian Murphy" <bmurphy@N_O-SPAM_kellerhewitt.com> wrote ...

Exchange Calendar Item vs. Outlook problem
Our Exchange 5.5 (SP4) server has what appears to be a corrupt calendar item for January 20, 2004. Those people who have this recurring(?) calendar item experience an Outlook lock up (CPU 100% running process outlook.exe) when accessing their calendar for that date and when syncing for offline Outlook use. This effects Outlook versions 2000 and 2002. Because the item can not be accessed from an Outlook client it can not be deleted. Is there a way to delete recurring calendar items from a specific date in the private data store? Is there an Outlook patch that prevents the CPU utilization p...

Cell References: R[-2]C[0] vs A10
One of my excel spreadsheet suddenly replaced all of the "normal" Ax references to R[x]C[y] references. How to I restore the default reference system??? Thanks In Excel 2007: Office button>Excel Options>Formulas>Working with formulas>uncheck R1C1 reference style>OK Other versions of Excel: Tools>Options>General tab>Settings>uncheck R1C1 reference style>OK -- Biff Microsoft Excel MVP "Arthur" <Arthur@OregonKoiGardens.com> wrote in message news:D237D1FE-AC5B-40EC-B535-32EC8121F8EA@microsoft.com... > One of my excel spreads...

Problems bringing a CView to the foreground
Hi de hi, I'm working on an MDI app where we popup a dialog, then another dialog, input some info into the dialog, then we want to display a CView based graph on top of this. We need to zoom in/out etc, then eventually close the graph, and be back in the last dialog. I've scoured this newsgroup for ways to do this, and found several; unfortunately none of them work. I've tried the 3 following ways (all at the end of the OnDraw of the CView) GetParentFrame()->ActivateFrame(); ((CMDIFrameWnd*)GetParentFrame())->MDIActivate(this); SetWindowPos( &CWnd::wndTop, 0, 0, 0,...

VS Tools for GP9
Is there any way to loop through the line details? The only way I able to get the line details is thru line event but only return that single line details. Would you like to loop via SQL instead since you are in VST anyway. Line records are already commited to tables thus available via SQL unless you are using temp tables. ---Darryl Bajaro "TKT" wrote: > Is there any way to loop through the line details? The only way I able to get > the line details is thru line event but only return that single line details. ...

XmlDocument vs XPathDocument performance
Hi... I've been trying to improve the performance of our xml handling, so I've been doing some timing tests lately and ran across something I thought odd - XPathDocument seems slightly slower than XmlDocument. I've run the tests several times and have tried to eliminate extraneous variables like disk access but every time, XPathDocument comes up slower by a few percent. I'd expected it to be faster since it's a read-only representation. Am I doing something wrong? start = Timers.QueryPerformanceCounter(); for (int idx = 0; idx < 50000; idx++) { StringReader...

column headings in numbers vs letters
For some reason all my excel files now display columns as numbers rather than letters. How can I change back to letters? Why are all my old files also now reading in numbered columns? This is a setting of Excel, not of your files. Tools>Options>General, uncheck R1C1 Reference style -- Kind Regards, Niek Otten Microsoft MVP - Excel "garyflood" <garyflood@discussions.microsoft.com> wrote in message news:6870D172-C11D-4FF9-A7D8-48BE89149DF8@microsoft.com... > For some reason all my excel files now display columns as numbers rather > than > letters. How...

Another VS 2005 question
Thank you for all the comments you gave me on the question on upgrading from VS 6 to VS 2005. I downloaded VS 2005 Express and started playing.... However, an application created with VS 2005 (on a Vista machine) runs fine on that machine, but does not run on another machine (happens to have XP). An error message pops up about something wrong with the application settings. Any ideas? I searched Google and it seems that this problem is somewhat common, but I don't know what to do about it. Thanks, Harald Could you list the error message? Perhaps a DLL is missing from the other ...

LocalAlloc vs CreateFileMapping/ MapViewOfFile
Test was run on iMx31 at 400 MHz. Recently I went to an unexplained behavior with those functions. Using LocalAlloc for (example) 32 MB takes about 450 ms and the same allocation using CreateFileMapping/ MapViewOfFile takes about 3 ms. Also filling buffer from LocalAlloc pointer is faster than filling buffer from CreateFileMapping/ MapViewOfFile pointer! Anybody has an explanation for this? Regards. On 1/8/2010 2:21 PM, fd wrote: > Test was run on iMx31 at 400 MHz. > Recently I went to an unexplained behavior with those functions. > Using LocalAlloc for (example)...

macro 2003 vs 2007
I created a 2003 file with macros. Some of our people use 2007..how can I get the macors from 2003 to work i 2007? Ron They should work ok. There are some that have been killed. If you find one that doesn't, post here with details and we will help. -- Don Guillett Microsoft MVP Excel SalesAid Software dguillett@gmail.com "dboat" <dboat17@aol.com> wrote in message news:6facb062-4292-4378-894b-ccaedaaf8e97@u26g2000yqu.googlegroups.com... >I created a 2003 file with macros. Some of our people use 2007..how > can I get the macors from 2003 to work i 20...

MDI CView and some kind of bar at bottom of CView
Hi, I have created a MDI project with CView's using VS2008Pro. I want to have some sort of bar at the bottom of every CView where i can put controls on, like buttons. I dont know how this bar is called and how to create one for every CView. I have a picture of it here to explain what i want. http://www.4shared.com/dir/32975742/b4bac91c/CView_Bar.html Could someone please tell me what kind of bar this would be and how to create it for CViews? Thanks. I don't see any bar at the bottom of your linked picture. CView's do not have bars: CView's only fill what i...