?
Solved

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

Posted on 1999-01-20
2
Medium Priority
?
514 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

770 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