SDI with Multiple Views (and retaining CSplitterWnd)

SDI with Multiple Views (and retaining CSplitterWnd)

Post by Andre Rosentha » Sun, 20 Oct 1996 04:00:00



Yall,

Searching MSDN I found sample called VSWAP32 with implements a method to
have multiple views for a SDI app.
However, the published method does not work with CSplitterWnd for it
relies on the AFX_ID_FIRST_PANE to be reused inside an array of IDs at
the CWndApp (see sample code by going to VC++ -> HELP -> SEARCH ->
VSWAP.
My question is as follows : I want to have n views that are
interchangeable via toolbar selection on a SDI application. I do have 1
view which is a CTreeView1 side by side with a CLIstVIew1 and now I want
to change the view to a different CTreeView2 side by side to a
CFormView2.

The first task I did was to change the OnCreateChild of CMainFrame,
added a static view to m_splittWnd as (1,2); at pane (0,0) I added view
CTreeView1 and a view at pane (0,1) to represent the CListView.

Now I would like to change the view to have at pane (0,0) the CTreeView2
and at (0,1) CFormView2.

Any ideas ... ???

The method at CSWAP does not work only because of the splitterWnd being
used (disclaimer is at MS code).

Cheers ...

Andre Rosenthal

Quote : It is a lot easier to MF_C_ than to MF_DO_ !!!!!!!!!!!

 
 
 

SDI with Multiple Views (and retaining CSplitterWnd)

Post by Claes Bergefal » Tue, 22 Oct 1996 04:00:00


Check the following article in KB:
ID: Q102827
"Replacing a view in a splitter window"

-----------------------------------------------------------------------
Claes Bergefall, M.Sc. CSE
Softronic, Sweden


WWW: http://www.softronic.se/users/claes
-----------------------------------------------------------------------



Quote:> Yall,

> Searching MSDN I found sample called VSWAP32 with implements a method to
> have multiple views for a SDI app.
> However, the published method does not work with CSplitterWnd for it
> relies on the AFX_ID_FIRST_PANE to be reused inside an array of IDs at
> the CWndApp (see sample code by going to VC++ -> HELP -> SEARCH ->
> VSWAP.
> My question is as follows : I want to have n views that are
> interchangeable via toolbar selection on a SDI application. I do have 1
> view which is a CTreeView1 side by side with a CLIstVIew1 and now I want
> to change the view to a different CTreeView2 side by side to a
> CFormView2.

> The first task I did was to change the OnCreateChild of CMainFrame,
> added a static view to m_splittWnd as (1,2); at pane (0,0) I added view
> CTreeView1 and a view at pane (0,1) to represent the CListView.

> Now I would like to change the view to have at pane (0,0) the CTreeView2
> and at (0,1) CFormView2.

> Any ideas ... ???

> The method at CSWAP does not work only because of the splitterWnd being
> used (disclaimer is at MS code).

> Cheers ...

> Andre Rosenthal

> Quote : It is a lot easier to MF_C_ than to MF_DO_ !!!!!!!!!!!


 
 
 

1. MFC2- multiple views in sdi, via dlls

Calling all MFC2 gurus!

problem: explicitly calling Create on a view class which is
defined in an extension DLL => ASSERT(FALSE)

I'm implementing multiple-view behavior within an SDI app.  
I'm using an approach suggested by the MS knowledge base
on Nov 19, 1993.  <See doc#Q99562 - Switching Views in a
Single Document Interface program>.  In a nutshell, this
approach is to explicitly allocate, create, and initialize
your extra views, and manage switching between them yourself.

It has worked fine so far. Now, though, I'd like to use a DLL
resident view class as one of the additional view classes.  
My app dies during the explicit call to Create on that view,
with an ASSERT failed in viewform.cpp, line 62.  

I've tried allocating this view in the DLL, which didn't fix
it, and then instead in the exe project itself, and that
didn't work.  I had the same assert with both.

The dialog template for the view is a direct copy of one that
worked within the original app.  The ID is unique.  Is
something the matter with my extension DLL's resource file?

Inside Visual C++ mentions some work-arounds using
DLL-resident views in chapter 26 (page 515) but doesn't
discuss this special case I'm working on.  Since I'm not
passing the view into the AddDocTemplate call, I don't have
any compile problems with the RUNTIME macros.

     Thanks in advance for any net.wisdom.  I'd appreciate
replies by email, and I'll summarize any solutions back out
to the net.

     Sandy

--
Sandy Schindler                |                     Club Zed    

2. API for Internet services in Warp

3. SDI with multiple views...how?

4. Unable to set IP static

5. Multiple form views with SDI in MFC???

6. How to transfer files via Web Service?

7. MFC, SDI app with multiple form views??

8. CPU authentication...

9. Best way to attach multiple views to SDI?

10. Replacing the view in a CSplitterWnd

11. retain or not retain on init?

12. Adding a splitter to a dynamically switched SDI view

13. Q: Tooltips in child control of non-Doc/View SDI frame