Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

displaying child windows(URGENT)

Posted on 2000-05-04
9
Medium Priority
?
179 Views
Last Modified: 2013-11-20
Hi,
   I have devised an application,whereby on pressing a toolbar button one view should be displayed as a child view. I have five toolbar buttons and i want it to display five different forms on pressing each of the toolbar. All these forms should be child forms.
I have submit the application tommorrow
Please help me in this regard.

Thanx,
Thiru
0
Comment
Question by:thirumaran
9 Comments
 

Expert Comment

by:hchopra
ID: 2778253
You could create an MDI application with multiple doc templates. Each doctemplate could have a differnetn view attached to it. Thus you could have five different view types (eg form view, list view etc) associated with the same document. you can then handle the commands from the tool bar buttons and display and destroy the views accordingly.
 
Certainly feasible but a little difficult in one day.
0
 

Author Comment

by:thirumaran
ID: 2779430
Please explain it and give me the source code for it
Thanx,
Thiru
0
 
LVL 12

Expert Comment

by:migel
ID: 2779890
Hi!
hm you can do it in the SDI application:
just in the MainFrame window add 5 pointers to the needed views and one to hold currently active view.
After application is open MainFrame show view that was described in the AddDocTemplate() statement of the CApp::InitApplication()...
in the CMainWnd add handlers to the switch view commands. In this handlers check what view must be displayed and then hide current active view (by m_pActiveView->ShowWindow(SW_HIDE), and display needed view.

for example:
// we need second view
if (!m_pViewsArr[1])
{
m_pViewsArr[1] = new CMyView2(..);
if (!m_pViewsArr[1])
return;
m_pViewsArr[1]->Create(...);
}

m_pViewsArr[1]->ShowWindow(SW_SHOW);
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 12

Accepted Solution

by:
migel earned 160 total points
ID: 2779899
ooops it must be comments :-)
0
 

Author Comment

by:thirumaran
ID: 2780323
Hi migel,
   Cud u please elaborate a bit on it and if possible give me the exact source code for it.

Thanx,
Thiru
0
 
LVL 12

Expert Comment

by:migel
ID: 2780398
hm,
can you send me your test project?
this code too big to paste into the forum edit :-).
my Email:
migel.geo@yahoo.com
0
 

Expert Comment

by:JohnPhelps
ID: 2780905
Hi,

If I understand the request, you have one "main" form and want to be able to show 5 sub/child forms. If this is correct, pls carry on reading.

I had a database app. where I would show the BLOB's in the db in individual child windows.

This was achieved by :
In my view class, I created the child windows -:
pImgWnd[i] = new CImgWindow(); (Derived from CWnd)

Initialised the child window variables to determine the image type and displayed the window -:
if (pImgWnd[i]->nImgType == DAO_FORMAT){
            pImgWnd[i]->m_DAOPicture.m_hData = m_pSet->pImgArray[i]->m_hData;
            pImgWnd[i]->m_DAOPicture.m_dwDataLength = m_pSet->pImgArray[i]->m_dwDataLength;
      }

pImgWnd[i]->Create(NULL, WinTitle, WS_CHILD, pImgWnd[i]->WindowPos, this,
            NULL, NULL);

In your case you could create & destroy the child windows in response to the toolbar buttons, which would be mapped to your view class.

If this code will help, mail me at jphelps@global.co.za or johnp@delarue.co.za
0
 

Author Comment

by:thirumaran
ID: 2809285
Adjusted points from 30 to 40
0
 

Author Comment

by:thirumaran
ID: 2809289
Thanx a lot for the help which you provided.

Thiru
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

972 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