Solved

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

Posted on 1999-01-20
2
475 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Strange date stored 22 100
Detect CR LF to each line 12 137
fizzArray  challenge 1 47
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 47
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now