|
anasshad wrote: The problem is that it is not looking very good. Meaning what exactly?
"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,
I have a slider control on a dialog box. I am playing a video file and slider moves according to the video elapsed. Suppose I have set the slider range to 100. Now till some point say 90, the slider moves to the point wherever I click the mouse. but at the last point in between some range say 90 - 100 (to the end of the slider), if I click the mouse button anywhere, slider jumps to the end.
I am using a TimeLine control where user can add more than 1 video (1, 2, 4, 8, 10 , 50 etc......), If I use only one video, slider moves as per the video progression.....Issue arises when I add more than 1 video and click on the start button, slider starts moving....Now when I drag the slider to any position or I click the mouse button anywhere on the slider control, slider thumb moves to that position and immediately jumps back to some other position. This is the Issue, I am facing.
Can anybody share some sample code where slider is moving with the video showing the progress of the video.
I want to implement a functionality similar to VLC player. Wherever user clicks the mouse, slider moves to that point.
Any help will be appreciated.
Regards,
Mbatra
modified 3-Jul-13 9:15am.
|
|
|
|
|
Derive you own class from CSliderCtrl and handle the left button down
(I have no merit, this is from a simple google search)
void MySlider::OnLButtonDown(UINT nFlags, CPoint point)
{
CSliderCtrl::OnLButtonDown(nFlags, point);
CRect rectClient, rectChannel;
GetClientRect(rectClient);
GetChannelRect(rectChannel);
int nPos = (GetRangeMax() - GetRangeMin())*(point.x - rectClient.left - rectChannel.left) / (rectChannel.right - rectChannel.left);
SetPos(nPos);
}
Nihil obstat
|
|
|
|
|
I have done this...its working ....
Please read below:
Hi,
I have a slider control on a dialog box. I am playing a video file and slider moves according to the video elapsed. Suppose I have set the slider range to 100. Now till some point say 90, the slider moves to the point wherever I click the mouse. but at the last point in between some range say 90 - 100 (to the end of the slider), if I click the mouse button anywhere, slider jumps to the end.
I am using a TimeLine control where user can add more than 1 video (1, 2, 4, 8, 10 , 50 etc......), If I use only one video, slider moves as per the video progression.....Issue arises when I add more than 1 video and click on the start button, slider starts moving....Now when I drag the slider to any position or I click the mouse button anywhere on the slider control, slider thumb moves to that position and immediately jumps back to some other position. This is the Issue, I am facing.
Can anybody share some sample code where slider is moving with the video showing the progress of the video.
I want to implement a functionality similar to VLC player. Wherever user clicks the mouse, slider moves to that point.
Any help will be appreciated.
Regards,
Mbatra
|
|
|
|
|
I want to customize the header of a listview, so in NM_CUSTOMDARW i have
Test = (LPNMLVCCUSTOMDARW)Lp <<lparam
(Test->nmcd.hdc) which for the listview without the header, i tried using
Test = (LPNMCUSTOMDARW)Lp <<lparam
and then
Test->hdr.hwndFrom
so
if(Test->hdr.hwndFrom == listview_getheader(LIST))
but it does not work, the listview_getheader(LIST) gives the right hwnd, but how about Test->hdr.hwndFrom, it seems i missed something...
|
|
|
|
|
JoneLe86 wrote:
Test = (LPNMCUSTOMDARW)Lp <<lparam What is Test and what is its value, and that of lp , after this statement?
Use the best guess
|
|
|
|
|
LPNMCUSTOMDARW Test = (LPNMCUSTOMDARW)lp
I was in the wrong way, Jochen Arndt explained that I should subclass the header first...
Thanks
|
|
|
|
|
|
hmm I wonder why Everything need to be subclassed, thanks for this information it did help....
|
|
|
|
|
The AviSplitter Filter's input pin, according to the MSDN is accepting the following mediatype
MEDIATYPE_Stream, <br />
MEDIASUBTYPE_Avi
While my own async filter is trying to connect with this filter in the method (located in amfilter.cpp file)
HRESULT CBasePin::TryMediaTypes(IPin *pReceivePin, __in_opt const CMediaType *pmt, IEnumMediaTypes *pEnum)
at the following statement that it supposed to receive the AVISplitter input pin, mediatype,
hr = pEnum->Next(1, (AM_MEDIA_TYPE**)&pMediaType,&ulMediaCount);
it retuns FALSE.
Why is that happens ?
sdancer75
|
|
|
|
|
|
Thanks,
It seems that AVISplitter does not suggest any mediatype but my mediatype fails at
hr = pReceivePin->ReceiveConnection((IPin *)this, pmt);
with error code 0x8004022f
Do you have any idea ?
Regards,
sdancer75
|
|
|
|
|
And what does that error code tell you?
Use the best guess
|
|
|
|
|
Debugging the dshow library, the first error internal decription is
0x8004022f error code<br />
VFW_E_INVALID_FILE_FORMAT
but the same dshow method returns to the caller, the following description
VFW_E_NO_ACCEPTABLE_TYPES<br />
0x8004022f
I think that something wrong is going on with my code in my async filter.
HRESULT result = m_pIo->SyncRead(llPosition, lLength, pBuffer);
It reads the first 0x18 bytes and after that, it returns the error. Other tests I did, it continues to read or parsing the avi file, but my code fails.
If its not a read error, then something wrong went with the AVI header parse or the MediaType templates declaration.
Note that the AVI is fine and is tested successfuly with other 3rd party players.
Regards,
sdancer75
|
|
|
|
|
Ok Solved.
My mistake was a command in the
CAsyncFilter::Load(LPCOLESTR lpwszFileName, const AM_MEDIA_TYPE *pmt)
function that is changing the absolute offset inside the file !!! I added that, for debugging purposes and I forgot to delete it when I reloaded the project a few days later.
So it was a read error !
Thank you.
PS : I was looking for that error one month now ! Oh God !!!
sdancer75
|
|
|
|
|
I have a process that some how fail at Initialization
it is a MFC C++ app so I inserted a __debugbreak at the first possible instance
which would be CWinAPP constructer the code starts but never seems to reach that point
(probably something to do with the build)
When I run this app from task manager I see it start and then it disappears
The Program when Initialized display a Main Window
I originally started this program using CreateProcess I get a return code 1 inidicating sucesss
but like I said it dies at initialization
When I run this program using "Start Debugging" from the Visual Studio IDE it seems to performs
properly
I am thinking That I use CreatePrcess with the DEBUG_PROCESS flag to get a better handle on
The problem
I appreciate any help
Thank you
|
|
|
|
|
Try to log the startup sequence by some log mechanism, like OuputDebugString() or File write.
Is there any chance to have code which will run in Release mode?
Any code which is written by compiler directive like #ifndef.
#ifndef _DEBUG
..
#endif
The following link may help you to find out this issue.
http://forums.codeguru.com/showthread.php?269905-Visual-C-Debugging-Why-does-program-work-in-debug-mode-but-fail-in-release-mode
In the debug build, if you have incorrect message handler signatures this doesnt cause any problems.
But MFC does a couple of naughty type casts in the message map macros. So when you build the same code in release mode, you are guranteed to run into trouble.
|
|
|
|
|
Let me clarify I run the VC debugger from
The release mode code along with the .pdb I am able to see what's going on
|
|
|
|
|
Yes it is possible to debug in release mode.
Details are given in the following link.
If an application works in a debug build, but fails in a release build, one of the compiler optimizations may be exposing a defect in the source code. To isolate the problem, disable selected optimizations for each source code file until you locate the file and the optimization that is causing the problem. (To expedite the process, you can divide the files into two groups, disable optimization on one group, and when you find a problem in a group, continue dividing until you isolate the problem file.)
http://msdn.microsoft.com/en-us/library/fsk896zz.aspx
|
|
|
|
|
Somewhere between the initlization and the CWinApp constructer the code
dies
I think using DEBUG_PROCESS flags will send events at everypoint till
the process is created
|
|
|
|
|
I have a client system, to create a CMainFrame object, but I am afraid that there will be memory leak about CMainFrame object.After step in, I cannot find where the m_pMainWnd pointer is deleted. Will I delete this pointer in the function
ExitInstance()?
BOOL CApp::InitInstance()
{
CMainFrame* pMainFrame = new CMainFrame();
if (!pMainFrame) return FALSE;
pMainFrame->LoadFrame(IDR_MAINFRAME,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
NULL);
m_pMainWnd = pMainFrame;
m_pMainWnd->UpdateWindow();
return TRUE;
}
int CApp::ExitInstance()
{
return CWinApp::ExitInstance();
}
|
|
|
|
|
yu-jian wrote: After step in, I cannot find where the m_pMainWnd pointer is deleted. It's handled automatically by the framework.
"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
|
|
|
|
|
Oh, sorry, I do not use the .net.
This is the unmanaged C++. I cannot see where the system delete this pointer in file appcore.cpp.
|
|
|
|
|
yu-jian wrote: Oh, sorry, I do not use the .net. What does that have to do with anything?
yu-jian wrote: This is the unmanaged C++. If you mean this is the unmanaged C++ forum, of course it is. Did something indicate otherwise?
"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
|
|
|
|
|
It is is deleted inside CFrameWnd::PostNcDestroy() (see winfrm.cpp) which is called by CWnd::OnNcDestroy which is the last member function called when the Windows window is destroyed.
|
|
|
|