Creating mulitple Forms within and SDI without the frame

I have been banging my head over how to create multiple forms or form views in an SDI.  The forms will be linked together like a flow chart.  These forms or form types will carry information that will be played back in the order that they were created. I need the sdi to keep track of the work area, ie scroll out to accomidate the number of form/form types.  I have been looking at ways to overwrite the CFrameWindow or CFormView class to create a no border frame so that visible links can be created in the work space as well.
Thanks yet again guys.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mahesh1402IT ProfessionalCommented:
>>have been looking at ways to overwrite the CFrameWindow or CFormView class to create a no border frame

First in your FRAME, override the PreCreateWindow and set: = WS_POPUP;
cs.dwExStyle = 0;

after you have called the CFrameWnd::PreCreateWindow.

Example code :

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
        BOOL retval;
        // TODO: Modify the Window class or styles here by modifying
        //  the CREATESTRUCT cs
        retval = CFrameWnd::PreCreateWindow(cs); = WS_POPUP;
        cs.dwExStyle = 0;
        return retval;

Then in your View you also need to override the PreCreateWindow.

Example code :

BOOL CBrowserView::PreCreateWindow(CREATESTRUCT& cs)
        // TODO: Modify the Window class or styles here by modifying
        //  the CREATESTRUCT cs

        cs.dwExStyle = 0; &= ~WS_BORDER;
        return CFormView::PreCreateWindow(cs);

Doing both of these things will remove the SDI border.  Hope this helps...

AndyAinscowFreelance programmer / ConsultantCommented:
For me your question is very unclear as to what you really want.
If you remove the border the user would find it difficult to resize (and move) the window of your app.

Do you want a form as in a dialog (edit, text, list....) or do you just want to display different 'pictures' as you also talk of flow chart ?

Create dialogs in the resource editor and display them to fill the child area of the view, hide them when not required.  
The OnPaint of the view can be used to 'draw' in the view.

Visible links in work space ?  Do you mean having a window for example like explorer where one part shows items (files, folders...), selecting an item changes the display in the other part ?

One of the steps in the wizard to create a new app is the option to have it explorer style - that creates a splitter window with two views, one can then modify the views as you require.
graberAuthor Commented:
In one sense the application will look like rational roses. In one view your are able to see the relationship between various entities graphically.  Resizing a dragging are not an issue.  At this juncture I need to create about 5 diffrent classes of dialog boxes or forms that will be parented by an SDI/MDI frame work.  The frame work will keep track of how they are linked together but the forms will be classes of container types to hold data.  You also see the same basic type of frame work in Microsoft Access when you look at the links of a database.

Mahesh why am I altering the CMainFrame class precreate?
AndyAinscowFreelance programmer / ConsultantCommented:
in .h file

CMyDlg1* m_pDlg1;
CMyDlg2* m_pDlg2;
these are pointers to each of the dialogs you want to have displayed

in .cpp file
constructor of view - initialise each dialog pointer to NULL

in OnInitialUpdate
m_pDlg1 = new CMyDlg1(this);
m_pDlg1->Create(IDD_MYDLG1, this);
...  same for each dialog.

Now use
m_pDlg1->ShowWindow(SW_SHOW);  //Show dialog1
m_pDlg2->ShowWindow(SW_HIDE);  //hide dialog 2
this displays the dialog you require.

In the OnSize of the view
m_pDlg1->SetWindowPos(NULL, 0, 0, cx, cy, SWP_NOZORDER);  //cx, cy are the size of the client area - makes the dialog fill the client area

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AndyAinscowFreelance programmer / ConsultantCommented:
In the dialog editor make certain the dialogs have no border, is are child (NOT popup), visible set to false to reduce flickering when they are created should it be a problem.
You may need to set the size of the dialog when you create them - I am not certain if the OnSize will come before or after the OnInitialUpdate
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.