Creating a class through class wiz which derives from a class not listed

Creating a class through class wiz which derives from a class not listed

Post by Michael Olivier » Thu, 07 Nov 1996 04:00:00



I'm building an MDI app with two panes on a CSplitterWnd window. I think
I want to use that splitter window to receive the messages from my
toolbar which are currently being received by one of the panes
(CTreeView derived, if that matters). I've run into a problem that Class
Wizard, under "Class Info"\"Add New": CSplitterWnd isn't listed as a
base class.  I can subclass it myself but I want Class Wizard to do it
(RAD and all, you know).

First, is it a good idea to be using CSplitterWnd to handle messages for
the panes?

Second, is there a way to get ClassWiz to build it for me?

TIA,
Mike

 
 
 

Creating a class through class wiz which derives from a class not listed

Post by gjk » Fri, 08 Nov 1996 04:00:00


Mike,

Sorry I can't answer your CSplitterWnd specific question, but with regards
to Class Wizard, I have used a number of extension DLLs and in order to
get Class Wizard to do some of the work for me I create a class derived
from generic CWnd and then modify the source code accordingly.  It is not
all that swift, but it works !

good luck
regards
Gary



Quote:> I'm building an MDI app with two panes on a CSplitterWnd window. I think
> I want to use that splitter window to receive the messages from my
> toolbar which are currently being received by one of the panes
> (CTreeView derived, if that matters). I've run into a problem that Class
> Wizard, under "Class Info"\"Add New": CSplitterWnd isn't listed as a
> base class.  I can subclass it myself but I want Class Wizard to do it
> (RAD and all, you know).

> First, is it a good idea to be using CSplitterWnd to handle messages for
> the panes?

> Second, is there a way to get ClassWiz to build it for me?

> TIA,
> Mike


 
 
 

Creating a class through class wiz which derives from a class not listed

Post by DaMiA » Wed, 13 Nov 1996 04:00:00



> I'm building an MDI app with two panes on a CSplitterWnd window. I think
> I want to use that splitter window to receive the messages from my
> toolbar which are currently being received by one of the panes
> (CTreeView derived, if that matters). I've run into a problem that Class
> Wizard, under "Class Info"\"Add New": CSplitterWnd isn't listed as a
> base class.  I can subclass it myself but I want Class Wizard to do it
> (RAD and all, you know).

> First, is it a good idea to be using CSplitterWnd to handle messages for
> the panes?

> Second, is there a way to get ClassWiz to build it for me?

> TIA,
> Mike

I also use CSplitterWnd in my application.
If your application is a MFC derived application, in CMainFrame
you declare an intance of CSplitterWnd and then, on  CMainFrame::OnCreateClient()
you create the two panes.

Here is a sample of my application:

BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpCreateStruct,
                                CCreateContext* pContext)
{
        // create a splitter with 1 row, 2 columns
        if (!wndSplitter.CreateStatic(this, 1, 2, WS_CHILD | WS_VISIBLE))
        {
                TRACE0("Failed to CreateStaticSplitter\n");
                return FALSE;
        }

        // add the first splitter pane - the default view in column 0
        if (!wndSplitter.CreateView(0, 0,
                pContext->m_pNewViewClass, CSize(Split, cy), pContext))
        {
                TRACE0("Failed to create first pane\n");
                return FALSE;
        }

        // add the second splitter pane - an input view in column 1
        if (!wndSplitter.CreateView(0, 1,
                RUNTIME_CLASS(CMyListView), CSize(cx - Split, cy), pContext))
        {
                TRACE0("Failed to create second pane\n");
                return FALSE;
        }

        // activate the input view
        SetActiveView((CView*)wndSplitter.GetPane(0,1));

  return TRUE;

Quote:}

My application was first based on Viewex (sample from Visual C++ 4.0 CD)
This sample will help you developing an App with CSplitterWnd.

Hope this helps.

Miguel.
--
---------------------------------------------------------------

---------------------------+  R Alves Redol n 9 - sala 338      
Antonio Rodrigues          |  1000 Lisboa Portugal            
Daniel Amendoeira          |    Tel: +351 1 3100000   Ext: 2552
Miguel Algarvio            |    Fax: +351 1 3145843            
---------------------------+-----------------------------------

 
 
 

1. Derive a class from CRecordset class and have the derived class appear in Classwizard Dropdown

Hi,
I want to do the following:

Derive a class from CRecordset that extends the functionality of CRecordset
BUT does
not yet reference any specific recordset. (an abstract class I guess).
I want this derived class to appear in the "base class" dropdown of the MFC
Class Wizard "Automation" tab
when I select "new Class".

The problem is I can only use class wizard to create new derived class from
CRecordset when I actually
want to create a new derived class specialised for a certain recordset from
my new baseclass.
Is this possible?
At present I select CRecordset and manually edit the resulting CRecordset
derived class.
Visual Studio enterprise V6.0SP3

Cheers,
Andy Cullen

2. ASUS A8V Deluxe

3. Use class wizard to derive a new class from a present class?

4. How is net adpater chosen from 2 using Terminal Server under CE 3.0

5. classwizard and making a derived class a base class for another class

6. System Error

7. How to: CCmdTarget derived class inside another CCmdTarget derived class.

8. Text?

9. using a derived class of a CView derived class

10. Template class derived from a Template class???

11. MFC Derived Classes from Classes

12. Deriving a C++ class from an imported C++ DLL class?

13. Unable to find class in .H and .CPP (how create base class?)