|
Hi,
I am working on a project program that have the popup progress bar with "continue" and "pause" buttons in the dialog. I have the problem to pause and to continue the progress. For example, when the progress dialog starts, the user click on the "pause" button, the progress bar must be paused until the "continue" button is pressed but I don't know how to pause the progress when the pause button is pressed and how to continue the progress bar when the continue button is pressed.
Any help will be appreciated.
Regards,
Mbatra
|
|
|
|
|
mbatra31 wrote: but I don't know how to pause the progress when the pause button is pressed and how to continue the progress bar when the continue button is pressed.
stop function which calling ProgressCtrl.StepIt() function!, during the time user pressed pause!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
Thanx for the reply. I have used ProgressCtrl.StepIt() function inside OnTimer() so that while playing the video, timer will increment and progress bar also steps up.
I Can't stop this one. Because In StopTimer function I have set the state of the timer and progress bar to zero.
Basically I am incrementing the Progress Bar along with the timer. When User Presses Pause button, both the progress bar as well as timer should stop at their current state. ANd when user presses play button Timer and progress bar should continue from their last stopped state.
I have used ProgressBarCtrl.SetState(PBST_PAUSED); function, this works and progress bar stops at its current state, but its not so smooth, when user presses play button, progress bar increments by not just 1 step, but 3 -4 steps. Also I am not able to stop the timer. it keeps on incrementing.
Please let me know your idea / suggestion to solve this.
Regards,
Mbatra
|
|
|
|
|
mbatra31 wrote: I Can't stop this one. Because In StopTimer function I have set the state of the timer and progress bar to zero.
you might need to decouple both! either create new functions like PauseTimer(BOOL bPause), that decision on stopping and starting of timer in that function, without actually modifying your timer or progressctrl state.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I was able to Pause the progress Bar on clicking Pause btn and again start from the same position on Play button, But Still unable to do the same for Timer.
I am using this piece of code to get the current time elapsed and display the same in the static and also stop the timer at that point.
KillTimer(nVID);
m_VideoPlay = 0;
GetTime = CTime::GetCurrentTime();
CString t = GetTimeElapsed(GetTime);
mStaticElapsedTime.SetWindowTextW(t);
GetTimeElapsed
() function returns the time in CString format (00:00:00) to display in a static box.
KillTimer function not working here.
Regards,
Mbatra
|
|
|
|
|
mbatra31 wrote: m_VideoPlay = 0;
what is the role of above
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
this is the return value from SetTimer function.
m_VideoPlay = SetTimer(Event ID, 500, NULL);
Now I was able to stop the progress bar and the timer also, but how to start the timer from the same position when user clicks on play button.
Suppose if user has paused the video at 6 secs, then when the user clicks on the play button timer should start from 6 sec only.
Any idea about this scenario.
Regards,
Mbatra
|
|
|
|
|
mbatra31 wrote: Suppose if user has paused the video at 6 secs, then when the user clicks on the play button timer should start from 6 sec only.
which control are you using to display the video!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I am using a picture control to display the video, play , pause and stop buttons on the dialog box to play/pause/stop the video. Play/Pause functionality has been implemented using DirectShow.
I am not able to start the timer from the time when user has paused the video. Timer should start incrementing from where it was stopped when user pressed the pause button.
Regards,
Mbatra
|
|
|
|
|
mbatra31 wrote: For example, when the progress dialog starts, the user click on the "pause" button, the progress bar must be paused until the "continue" button is pressed but I don't know how to pause the progress when the pause button is pressed and how to continue the progress bar when the continue button is pressed. This is all laid out in that article I linked you to earlier. When the timer is fired, DoTimerStuff() is called. That function checks to see if the audio file is playing. If not, nothing happens (i.e., the progress bar is not updated).
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Hi,
Thanks for the reply.
I have done the progress bar stop and continue.....but now Issue is with Timer. I am able to stop the timer when user presses the Pause button........Next when user presses the Play button, the timer is not updated.....it remains at that position only.
I have again started the timer when user presses Play button, but it does not increment, it remains at the position where it was stopped.
Any idea how to update the timer with the Pause and Play buttons.
Regards,
Mbatra
|
|
|
|
|
Hi,
I want to know whether opcode can give me the messages besides triangle. As mesh which is defined in the opcode is consist of triangles, but most of my model is constructed using polygons, so before my collision qurey, I have to transform the polygons to triangles, but i want to know wether i could know which polygon the triangles detected are belong to. if the anwser is yes, how can i get the message?
|
|
|
|
|
Henry Hong wrote: how can i get the message? How indeed! Perhaps you could start by explaining exactly what C/C++ problem you are trying to solve.
Use the best guess
|
|
|
|
|
Hello, as i want to use the OPCODE to perform collision detection,but according to the user manual, i can only get the vertex and normals that overlapped,so i want to know wether i can get the message about which polygon the vertex belong to. because that will be a important reason for me to decide wether use the OPCODE to perform my collision detection.
|
|
|
|
|
Henry Hong wrote: i want to use the OPCODE to perform collision detection When I asked you to explain what your problem is I expected something more than a repeat of your original question. What do you mean by "OPCODE" and where is this collision detection supposed to take place?
Use the best guess
|
|
|
|
|
OPCODE is developed for collision detection in computer graphics, do you have the experience on it. And as I have no, and I am surveying about which manners can meet my request.
|
|
|
|
|
|
I had got the resource from this address, and i also have read the mannual about the OPCODE, but as I want to learn some details about the OPCODE, I found it was difficult. And i had got the two projects "opcode" and "CDTestFramework" from that address. because i had not found the information about how to get which polygon the detected triangle is belong to in the user mannual. i hoped to find my anwser in the two projects above, but I find it was difficult to read the code in the two projects. if you had some experience about using OPCODE, i really wished you could give some suggestion about how to read the two projects. And as one of my request is two get the polygons, so if you know, can you tell me is there any manners i can get the polygons. If the answer is NO, i think I have to think about take us of other detection manners.
Thanks and Best Wishes.
|
|
|
|
|
you might get better results if you ask this in the Algorithms or Graphics forums. this is a C/C++ forum, and your question doesn't seem to have anything to do with C/C++.
|
|
|
|
|
Hi all,
I have a program that calls magnification.lib in windows 7, windows 8.
(I'm calling #include magnification.h)
But we know this library doesn't exist in windows XP.
How can I ignore this library when opening the application in windows XP?
|
|
|
|
|
Create function pointers in a header file for all the magnification APIs that you're going to use.
Check the OS version and if Vista or above, call LoadLibrary on Magnification.dll .
After this call GetProcAddress on the function to initialize the function pointer.
So the header file could look like this -
typedef BOOL (*PFN_MAG_INITIALIZE)(void);
From the main program, you could have a call to some function called InitMagnification .
In the InitMagnification function, do the dynamic loading after checking the OS version.
PFN_MAG_INITIALIZE MagInitialize = NULL;
if (osVersion >= "VISTA")
{
HMODULE hmod = LoadLibrary(_T("Magnification.dll"));
MagInitialize = GetProcAddress(hmod, "MagInitialize");
}
In the source where this function is called, do the checking as follows -
if (MagInitialize)
{
MagInitalize();
}
I have omitted error checking, which you have to do.
|
|
|
|
|
Thank you very much. After posting this question, I did exactly what you told me to do. Thank you again
|
|
|
|
|
thanh_bkhn wrote: But we know this library doesn't exist in windows XP. How can I ignore this library when opening the application in windows XP? Sounds like you need to read up on implicit vs. explicit linking.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Thank you. I performed an explicitly link to my DLL.
|
|
|
|
|
As an alternative, you could use delay load dll. In this case you do not need to change the code you have already written (related to statically linking to the library), all you need to do is just do not call chunk of codes related to magnification at all. Saves you a lot of annoying LoadLibrary/GetProcAddress calls.
However, it looks like you have already implemented it. So, just learn about this, so that you could use in future
|
|
|
|