|
just wanted to know how do i set the progress bar.. i am creating a media player.. a simple player where in we can play and stop the song. now i need to add more functionalites.. i want to implemeny a progress bar which moves as the songs goes on... or rather synchonizes with the song.. some leads.. if sombody has done is then please help me in doing this.
|
|
|
|
|
CProgressCtrl::SetRange()
CProgressCtrl::SetStep()
CProgressCtrl::StepIt ()
CProgressCtrl::SetPos ()
CProgressCtrl::GetPos ()
Use any of the above given methods.
Come online at:-
jubinc@skype
|
|
|
|
|
If you are using MFC, see here.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi all,
I have string like this.
First name: name
I want to get the string after the ':'. What is the easiest way.
I'm wired with my way, find the length, find the place where : sign include and stuck...
I appreciate your help all the time...
Eranga
|
|
|
|
|
If you're using MFC, it'd be easily done with the CString::Mid() function:
CString str = _T("Name: Rajesh");
int iPos = str.Find(_T(":"),0);
AfxMessageBox(str.Mid(iPos+1));
Or, if you aren't using MFC, then perhaps this helps you:
TCHAR *tch = new TCHAR(20);
tch = _T("Name:Rajesh");
while(tch++)
{
if(*tch == ':')
{
::MessageBox(NULL, (tch+1), _T("Message"), MB_ICONINFORMATION);
break;
}
}delete tch;
Last modified: 15mins after originally posted --
Rajesh.
|
|
|
|
|
And what is the purpose of heap allocated memory?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
My bad mood perhaps? Seriously, just typed it out fast, tried and pasted here. Shouldn't have been fragmenting the precious heap though. Will take care of this in the future, my lord.
|
|
|
|
|
Rajesh R Subramanian wrote: my lord
Wasn't Dunn?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
CPallini wrote: Wasn't Dunn?
Opph korse he izz.
|
|
|
|
|
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
If CString is used, write
CString str;
str.Mid (str.Find (':'));
If not using CString, write
char* pszName = strstr (variable, ":");
if (pszName != NULL)
{
pszName is valid pointer.
}
Come online at:-
jubinc@skype
|
|
|
|
|
Thanks, actually I'm trying this on standard C++ pal
I appreciate your help all the time...
Eranga
|
|
|
|
|
This what I have done
string strPT("First name: name");
int strLength = strPT.length();
int indexOfCol = strPT.find(':');
string strMess = strPT.substr(indexOfCol + 2, (strLength - indexOfCol));
I appreciate your help all the time...
Eranga
|
|
|
|
|
Hi All,
"<Name>get input from user </Name>"
is it possible to get input from user as depicted in the above method.
The console will echo the "Name" tag and the cursor should be blinking in between the start and end of "Name" tag where in the user should enter a valid input.
kindly let me know. Thanks.
Regards,
lgatcodeproject
|
|
|
|
|
May be you could use gotoxy() to put the cursor in between.
|
|
|
|
|
how to remove ugly border arround the CButton control ? in vista
in win2k3 its appears narmal
the black color border luks ugly in vista
please some one suggest me with the solution
|
|
|
|
|
Join microsoft's design team?
More usefully, for an application to get the Vista look, it need to include what's called a manifest.
Do a search for vista, application, manifest etc, and that should help.
Good luck,
Iain.
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
Iain Clarke wrote: More usefully, for an application to get the Vista look, it need to include what's called a manifest.
So should the OP be removing the manifest then (if he doesn't want the new look)?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
My reading was that he had a "classic" application, which was just fine when the OK and other apps matched.
Now he has it on a "shiny" os, the "classic" look doesn't fit in.
And I'm pretty sure that vista requires a manifest for the app before it will apply the new user controls look to it. Beyond that, it gets beyond me. I *think* a manifest is just some xml in the resources or in a similarly named (eg. myapp.exe.manifest) file nearby. Which is why I pointed him at google with the search clues in order to preserve my illusion of omniscience.
Iain,
Iain Clarke appearing in spite of being begged not to by CPallini.
|
|
|
|
|
I am debugging the application dealing with COM port.
The WaitCommEvent() function is called after setting mask with EV_RXCHAR and EV_TXEMPTY.
Even when there is no data coming from outside to COM port, WaitCommEvent() returns with new line character(10) continuously and the CPU usage becomes 100%.
Does anybody know why the new line character is coming?
Any help would be greatly appreciable!!
Best Regards,
Suman
|
|
|
|
|
rp_suman wrote: WaitCommEvent() returns with new line character(10)
WaitCommEvent returns a BOOL. Did you check if it returns TRUE ?
And what do you mean by "returns new line character" ? You read the port just after WaitCommEvent returns ?
Can you post a relevant code snippet ?
|
|
|
|
|
Hi, Sorry, WaitCommEvent() returns "false" and its 2nd parameter set to value RX_CHAR(i.e, 1)
and the ReadFile() function gives the new line character in its 2nd parameter.
Best Regards,
Suman
code snippet is here:
<br />
if(!SetCommMask(serialObj.m_hCom, EV_RXCHAR | EV_TXEMPTY)) <br />
return ERRCODE;<br />
<br />
while(serialObj.m_hCom != NULL)<br />
{<br />
BOOL bRet = WaitCommEvent( serialObj.m_hCom, &dwCommEvt, &serialObj.comReader );<br />
<br />
if ( dwCommEvt & EV_RXCHAR ) {<br />
<br />
do {<br />
retval = ReadFile( serialObj.m_hCom, &lpBuff, 1, &dwRead, &serialObj.comReader );<br />
<br />
if( retval && dwRead > 0 ) { <br />
<br />
....<br />
SetEvent(serialObj.hReadEvent);<br />
}<br />
}<br />
} while( dwRead > 0 );<br />
}<br />
}<br />
<br />
AfxEndThread(0);<br />
|
|
|
|
|
rp_suman wrote: WaitCommEvent() returns "false"
Well, that's your problem. The function failed. Did you check what was the problem by calling GetLastError() ?
BTW, did you check the documentation of the function ? You know that the function will return immediately when you are in overlapped mode ?
rp_suman wrote: AfxEndThread(0);
This is out of the context of your question but why do you call AfxEndThread here ? You should try to avoid killing your threads in such a brutal way, in general this can be easily avoided.
|
|
|
|
|
Hi, Thanks for the great help!!
I will check the points you have adviced.
Best Regards,
Suman
|
|
|
|
|
Hi,
After having WaitForSingleObject() function next to WaitCommEvent() function, the CPU rate become less.
With Thanks & Regards,
Suman
|
|
|
|