|
Hi,
I found one function strptime which converts string to time.I have included time.h and string.h header files . Even then i am getting the error 'strptime identifier not found;
|
|
|
|
|
sireesha_sree wrote: I found one function strptime...
Where? It does not appear to be part of MSVCRT.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
sireesha_sree wrote: i am getting the error 'strptime identifier not found
Because it isn't. Have a look at here [^]].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
If you are in VC++, you can get the strings for the time like that:
CTime time = CTime::GetCurrentTime();
CString szTime = time.Format ( "%A, %d.%B.%Y, %H:%M:%S" );
The CTime is a class and have methodes like:
GetTime Returns a time_t that corresponds to this CTime object.
GetYear Returns the year that this CTime object represents.
GetMonth Returns the month that this CTime object represents (1 through 12).
GetDay Returns the day that this CTime object represents (1 through 31).
GetHour Returns the hour that this CTime object represents (0 through 23).
GetMinute Returns the minute that this CTime object represents (0 through 59).
GetSecond Returns the second that this CTime object represents (0 through 61).
GetDayOfWeek Returns the day of the week (1 for Sunday, 2 for Monday, and so forth).
If you are in c++ then use the struct time_t (in < time.h >) and isollate every member of the struct to compare them.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
I succeded in fastforwarding the .wmv file in direct show but still
could not play rewind .
RajeshGupta
|
|
|
|
|
Do you mean play in reverse or position to an earlier time?
Some filters aren't capable of playing in reverse. Check the capabilities of the streams.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I mean to play in reverse i check
DWORD dwCaps = AM_SEEKING_CanSeekAbsolute | AM_SEEKING_CanSeekForwards | AM_SEEKING_CanSeekBackwards |AM_SEEKING_CanPlayBackwards;
HRESULT hr=g_pSeek->CheckCapabilities(&dwCaps);
is true . but still when i write code
g_pSeek->SetRate(-1.0);
graph could not play in reverse .
RajeshGupta
|
|
|
|
|
CheckCapabilities() returns true? That's not a proper capabilities check - actually if all the
capabilities you check for are available, it should return S_OK, which would be FALSE.
Regardless, the method returns an HRESULT, not a bool.
You should check something like this:
DWORD dwCaps = AM_SEEKING_CanSeekAbsolute | AM_SEEKING_CanSeekForwards
| AM_SEEKING_CanSeekBackwards | AM_SEEKING_CanPlayBackwards;
HRESULT hr=g_pSeek->CheckCapabilities(&dwCaps);
if (hr != S_OK)
{
if (dwCaps & AM_SEEKING_CanPlayBackwards)
{
}
else
{
}
}
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I am getting in step
if (dwCaps & AM_SEEKING_CanPlayBackwards)
{ // can play backwards }
can playback . but when i set rate
g_pSeek->SetRate(-1.0);
but is not playing in backbard . it just stop.
can you suggest me more refinement
RajeshGupta
|
|
|
|
|
What is the return value from g_pSeek->SetRate(-1.0); ?
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
the return value is 0. send me peace of code so that I can understand
clearly
RajeshGupta
|
|
|
|
|
Hi
I am in great trouble and still could not find the answer how to
rewind the wmv file.
RajeshGupta
|
|
|
|
|
still I could not able to rewind the file . can any one give me more help
that is explaned above with the help of some piece of source code.
RajeshGupta
|
|
|
|
|
I want to post a user defined message WM_PRINTLOG to the Main window in a Dialog based application from another thread started by the dialog.
That messag will be handled By a handler PrintLog(CString message) which prints the string(message) in to the edit box.
My question when i call PostMessage() how can i send the string (message) to the handler.
and how can i get the message at the ON_MESSAGE macro.
Thank you.
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: ON_MESSAGE
ON_MESSAGE handlers have the following signature
<code>LRESULT SomeMessage( WPARAM wString, LPARAM lNotUsed )</code>
{
if( !wString )
{
return 0;
}
CString* pString = reinterpret_cast<CString*>( wString );
MessageBox( *pString );
}
UINT SomeThreadFunc( LPVOID lpvParam_i )
{
CString csSomeCString = _T( "Nibu" );
::<code>SendMessage</code>( AfxGetMainWnd()->GetSafeHwnd(), WM_PRINTLOG, reinterpret_cast< WPARAM >( &csSomeCString ), 0 );
}
|
|
|
|
|
Thank you Nibu
KIRAN PINJARLA
|
|
|
|
|
UINT SomeThreadFunc( LPVOID lpvParam_i )
{
CString csSomeCString = _T( "Nibu" );
::SendMessage( AfxGetMainWnd()->GetSafeHwnd(), WM_PRINTLOG, reinterpret_cast< WPARAM >(&csSomeCString ), 0 );
}
Regarding to your comments. For user defined messages, people usually do Posting not Sending as PostMessage will return immedietly and thus lessen the thread delays. Use SendMessage if there is a reason for that.
Actually, your comment about newing and deleting is wrong. It is here we should either avoid of newing in a worker thread by posting it to UI thread or use SendMessage instead [opposed to what is said by comments]. The problem is the race condition [I'd say an obvious race condition]; if you PostMessage a newed object into another thread you may never be away whether that object has been deleted or not. A simple scenario is when the user closes the application jsut after the worker thread has done a PostMessage but before the UI thread ges informed about the message posted. Even with SendMessage you have to use some synchronization to avoid such unfavourable situations.
--
=====
Arman
|
|
|
|
|
Arman Z. Sahakyan wrote: people usually do Posting not Sending as PostMessage will...
...not cause a deadlock if the messagepump receiving the message happens to be in a blocked state.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
kiran.pinjarla wrote: My question when i call PostMessage() how can i send the string (message) to the handler.
Allocate it on the heap.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi,
We are trying to place FlexGrid in ATL window(CWnd Inheritance).
Create is successful, but we cannot get Interface properly.
We think that either one or both of the arguments for "QueryInterface" are
incorrect.
iCannot find REFIID in the help header file.j
Please let us know the solution for this.
Thanx & Regards
Ravi
|
|
|
|
|
I have a DISP_FUNCTION as below. the TBF parameter that needs to be filled is an enum value. How do I cater to an enum as a parameter in the DISP_FUNCTION.
DISP_FUNCTION(class, "method",method, VT_ERROR, VTS_I4 VTS_DISPATCH <tbf>)
|
|
|
|
|
I want to have a picture of type .bmp or .ico on my DialogBox. so how can i do that. Can anyone help me. Thanks in advance
Anil Jillella
|
|
|
|
|
On your dialog put picture frame left click than properties, select type (icom, bitmap)then select image (combo box offering you bitmaps or icons from res)!
Hope this was helpful!
|
|
|
|
|
thanks,i myself found the solution.
Anil Jillella
|
|
|
|
|
Add a static control on your dialog box using the resource editor, edit its properties, set its type to bitmap and specify the ID of the bitmap you want to use.
|
|
|
|