Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 1999-01-20
2
Medium Priority
?
523 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

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

Accepted Solution

by:
Tommy Hui earned 200 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

610 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