Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Rewrite URL With Encoded Characters 6 75
WinWaitActive parameters 12 31
Line meaning 9 82
Use of condition with 'serial' in ansible 2 49
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: 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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

911 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

17 Experts available now in Live!

Get 1:1 Help Now