MDI vs SDI Applications 
Author Message
 MDI vs SDI Applications

I'm still new to this thing, but I'm getting there...If anybody can help,
I'd appreciate it.  (I'd like to take this moment to thank Tim Sylvester for
all of his help.)

I created an application with AppWizard.  Multiple-Document Interface.

I have two document templates defined, with a call to the AddDocTemplate for
each one.

First Question:
    How do I get around using the default dialog that MFC puts up for
selecting which template to use?

Second Question:
    In the future, there will be several (about 10) document templates.
Some of these templates should not have more than one view open at a time.
Since I've had trouble doing this using a SingleDocTemplate for those views,
I've had to use a MultiDocTemplate for them.  Is there a way to check to see
if there is already a view of this document template open and if there is,
cancel the operation?  Also, it gets trickier.  One view can have a view
open only a certain number of times--based on the user's data (kinda like a
view for each customer in a database, but no customer can have more than one
view open at a time).

    Also, if anybody knows of a way to have an application with
SingleDocTemplates and MultiDocTemplates at the same time, I'd be glad to
hear your solution.

    I can't always get in here, so if you would be so kind, please reply
email =)

Thanks so much,
JaredBobby



Mon, 23 Oct 2000 03:00:00 GMT  
 MDI vs SDI Applications

JaredBobby,

Quote:
>First Question:
>    How do I get around using the default dialog that MFC puts up for
>selecting which template to use?

Each document template has a set of resources associated with it, the first
parameter to the constructor. One of these resources is a string table
entry. You can look at the help for GetDocString to see the breakout of this
string. The third substring of this string is called the fileNewName. If
this substring is null then this document template will not show up in the
file new dialog. Therefore, if only one of your document template strings
has a fileNewName, then it becomes the "default" template for file new and
you never see the file new dialog.

Quote:
>Second Question:
>    In the future, there will be several (about 10) document templates.
>Some of these templates should not have more than one view open at a time.
>Since I've had trouble doing this using a SingleDocTemplate for those
views,
>I've had to use a MultiDocTemplate for them.  Is there a way to check to
see
>if there is already a view of this document template open and if there is,
>cancel the operation?  Also, it gets trickier.  One view can have a view
>open only a certain number of times--based on the user's data (kinda like a
>view for each customer in a database, but no customer can have more than
one
>view open at a time).

Since OnFileNew (after the change above) will only open one type of view,
you will need to add your own method to open these other views. There are
methods of the frame window class to walk the list of open child frames. You
will have to do this and count the number of times the desired view is open.
Then respond accordingly.

Dave Smith



Tue, 24 Oct 2000 03:00:00 GMT  
 MDI vs SDI Applications

You could use the GetNextView functionm in combination with the IsKindof
function to determine if you have an open view.

Guido

Quote:

> I'm still new to this thing, but I'm getting there...If anybody can help,
> I'd appreciate it.  (I'd like to take this moment to thank Tim Sylvester for
> all of his help.)

> I created an application with AppWizard.  Multiple-Document Interface.

> I have two document templates defined, with a call to the AddDocTemplate for
> each one.

> First Question:
>     How do I get around using the default dialog that MFC puts up for
> selecting which template to use?

> Second Question:
>     In the future, there will be several (about 10) document templates.
> Some of these templates should not have more than one view open at a time.
> Since I've had trouble doing this using a SingleDocTemplate for those views,
> I've had to use a MultiDocTemplate for them.  Is there a way to check to see
> if there is already a view of this document template open and if there is,
> cancel the operation?  Also, it gets trickier.  One view can have a view
> open only a certain number of times--based on the user's data (kinda like a
> view for each customer in a database, but no customer can have more than one
> view open at a time).

>     Also, if anybody knows of a way to have an application with
> SingleDocTemplates and MultiDocTemplates at the same time, I'd be glad to
> hear your solution.

>     I can't always get in here, so if you would be so kind, please reply
> email =)

> Thanks so much,
> JaredBobby



Tue, 24 Oct 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Dialog box pop-up - SDI vs. MDI apps

2. MDI vs SDI

3. Help: CView with MDI vs. SDI

4. SDI vs. MDI apps

5. SDI vs MDI or multithreading?

6. Dialog box pop-ups - SDI vs. MDI apps

7. MDI vs SDI

8. SDI vs. MDI memory

9. mdi vs sdi display problems

10. SDI vs MDI, or mulththreading?

11. Transfer of a SDI application to MDI

12. Converting SDI to MDI application

 

 
Powered by phpBB® Forum Software