Solved

Using CSliderCtrl with CDialogBar in a VC++ 5 MFC/MDI program

Posted on 1999-01-20
2
487 Views
Last Modified: 2013-11-20
Hi, I need help and, if possible, detailed instructions as to how to use the slider and edit box controls in a dialog bar in a MFC/MDI program.

I have already created the dialogbar in the CMainFrame class of my program.

How can I get my views to access, update the controls in the dialogbar? (Problem: As my program progress with playing back an audio file, it should update the slider and editbox with the current frame being played.)

How can I get the controls to access the data/methods in the view? (Problem: When the user drags the slider, the program (i.e. the view) has to forward/reverse the audio file accordingly)

Thanks in advance.

Allan Tan
0
Comment
Question by:chaltan
2 Comments
 

Author Comment

by:chaltan
ID: 1328043
Edited text of question
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1328044
It seems like your main frame has a reference to the dialog bar. In your dialog bar, you need to handle the notifications from the slider and edit controls. From here, you will need to have a pointer to the document. GetActiveDocument() will return this to you. Then you can use IsKindOf to safely cast from CDocument to CYourDocument. Once you have a pointer to CYourDocument, call some methods in your document class to update the position. In these methods, you will need to call UpdateAllViews() and pass them information about the notification. Finally, your view has to override OnUpdate() to know about these notifications. This is for the user dragging the slider.

For your other problem, it is very similar. The view should call some methods on the document that will update the position. But these methods will use GetMainWnd() and need to cast to CMyMainFrm. Then you need to get the children of the dialog bar and update their values.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

810 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