Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MFC Doc-View

Posted on 1998-02-16
3
Medium Priority
?
541 Views
Last Modified: 2013-11-20
I have an MFC D/V application with 4 views displaying graphical information. Now i need to extend the application with as many views as the user configures of the basic 4 views. I anticipate memory and processor hogging since the user may finally need around 4x20 views or may be even further. Can anyone share ideas if they have done similar applications? Also i need to cascade,tile all such views like any MS application. Does MFC has provisions for that?
0
Comment
Question by:rajj012998
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 11

Expert Comment

by:mikeblas
ID: 1316267
4x20 means eighty, right?

Do you mean that you'll have eighty different view classes?  If so, you won't waste any extra CPU time. Your program won't even be that big because of all the CView-derived classes. If you're going to create a different CDocTemplate-derived object for each of those views, then you're going to run into resource problems because each CDocTemplate object will create and load a Windows menu object even when you've not created an instance of the doc/view/frame trio.

Do you mean that you'll have eighty different view windows open?
If so, you'll use lots of resources, since each view is a window you'll be taxing USER. If you have no child windows in each view, you'll probably not run into any limitations--even on Win95. But if you have a form in each window, you'll quickly run out of USER resources. You won't "hog" the processor here, either--though it might take a long time to restore your application if you want to recreate eighty view windows (with their corresponding frames) all at once.

Your application sounds like it's questionably architected, either way.

MFC will cascade and tile frame windows if you write an MDI application. If you've not written an MDI application, you're on your own. How do you envision eighty windows being cascaded?  You must mean that you have eighty different CView-derived classes.

.B ekiM

0
 

Author Comment

by:rajj012998
ID: 1316268
Thanks Mr. Mike. I have still some questions. Now the spec. runs
like this. The appl. will receive data from various other networked pc's through winsock. The application basically splits
the data and shows 4 different views of the single document. This
happens for one remote terminal getting connected. If more than
one terminal pump data to this application, the application
should show 4 other views corresponding to that data. The 4 views
are constant irrespective of no. of terminals connected.In short
4 views per terminal connected.

Now, how do i go designing the appl. Do i need more than one doc?
My spec reads that the user should be able to see view no1 of
all the terminals connected at a time. Is this possible?. If the
user wishes to switch between views, again 4 views corresponding
to different terminals should be shown.How can i go abt. this.

0
 
LVL 11

Accepted Solution

by:
mikeblas earned 10 total points
ID: 1316269
You problem description is very vague. Based on what I can glean from your description, here's what I'd say:

It sounds like you don't need more than one document class. You should have one document class, and it can hold the information about a connection and any data structures you'll need for your connection or the status or statistics that you're collecting.  You can create one instance of this calss for each connection.

You haven't adequately describe the views, so I can't tell if you need one single view class, or several. If each window you want shows data in a very different format than the others, you should create a new view class to implement that different UI. There's nothing wrong with having more than one instance of a given view class associated with each view class.

Instead of implementing framed views, you might want to consider using static splitter windows.  You can then make sure all four are more conveniently displayed in a single window.  Having lots of opened windows will tend to confuse your users and make it hard for them to navigate within your application.

Instead of creating so many sets of windows, you should consider having a combobox control in a dialog bar that lets the user select the connection that they want to view. When the user changes around the connection, you can update (or even recreate) the views when the user switches the selection.  That'll be lots, lots more convenient than juggling eighty windows.

I've provided two long answers to two different questions for ten points.

.B ekiM


0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question