|
James R. Twine wrote: Offset of where the...bad code begins?
Isn't this always at offset 0?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi
can anybody tell me any algoirthm to convert WAVE audio format to MP3.
thanks in advance
|
|
|
|
|
|
You don't need a library (you can write your own) if you know the WAV file format and the MP3
format/compression. Google may help
"If you can dodge a wrench, you can dodge a ball."
|
|
|
|
|
Well I have almost done the remove item from the list but the problem is that one item is rest each time in the listview when I clicked to “clearcomplete”.
In detail,
I add my files from the add button and select that file and proceed to protect, before protection the file shown the status “incomplete” but when the file protected
I had change the status to “complete” in the particular column. When a bundle of “complete” files seen in the list the user can remove it from the listview for that I have write the code
On WM_COMMAND providing one for loop , iterate up to count in each count checking out whether the column having “complete” then remove it, but when I fetch the status it shown me each time “complete” incase of when counter(i) contain the status “incomplete”.
Please check the code is it ok ?
case IDC_CLR_COMPLETED:
{
if(lParam==-1)
{
EnableWindow(hDlg,FALSE);
}
else
{
int count=ListView_GetItemCount(hList);
TCHAR buff[MAX_PATH]={0};
for(int i=0;i<count;i++)
{
ListView_GetItemText(hList,i,9,(LPWSTR)&buff,MAX_PATH);
std::wstring buff_input(buff);
std::string compare(buff_input.begin(),buff_input.end());
if(compare=="complete")
{
ListView_DeleteItem(hList,i);
}
}
}
}
break;
2) how can I call Wndproc again once I logout? Do I need to make any service for that? In my application there is login/logout funda.
Help ! me please!
Thanks & regards
Amit
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
amitmistry_petlad wrote: for(int i=0;i
First of all change your for loop logic, just reverse the loop like
for (int nIndex = nItemCount; nIndex >= 0; nIdex--)
This will solve one logical problem.
amitmistry_petlad wrote: if(compare=="complete")
Instead of checking like this, use any of the string comparing API..
Do your Duty and Don't expect the Result
|
|
|
|
|
Thanks appu!
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Parthi_Appu wrote: int nIndex = nItemCount;
Correction, Should be int nIndex = (nItemCount-1) .
|
|
|
|
|
prasad_som wrote: int nIndex = (nItemCount-1).
Do your Duty and Don't expect the Result
|
|
|
|
|
Parthi_Appu wrote: amitmistry_petlad wrote:
if(compare=="complete")
Instead of checking like this, use any of the string comparing API..
The operator== is part of std::string . Why would you suggest using some other function?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: Why would you suggest using some other function?
Confussed with Java
-- modified at 1:40 Friday 23rd March, 2007
Is that std::string has operator == overloaded?
Refer http://msdn2.microsoft.com/en-us/library/5zz6weyz(VS.80).aspx[^]
Do your Duty and Don't expect the Result
Rate this Post, if I helped You
|
|
|
|
|
Parthi_Appu wrote: Is that std::string has operator == overloaded?
operator==
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hey Thanx.
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
amitmistry_petlad wrote: int count=ListView_GetItemCount(hList); TCHAR buff[MAX_PATH]={0}; for(int i=0;i { ListView_GetItemText(hList,i,9,(LPWSTR)&buff,MAX_PATH);// I found the fault here might be the buff not cleared every time so its display “complete” every time incase of when item having “incomplet”. std::wstring buff_input(buff); std::string compare(buff_input.begin(),buff_input.end()); if(compare=="complete") { ListView_DeleteItem(hList,i); } }
I'm seeing immediate problem in above code. You are getting item count from list box. And used it in for loop for deleting items.
But with each deletion, this count should be decreased, where as you are refering to same old count .
amitmistry_petlad wrote: 2) how can I call Wndproc again once I logout? Do I need to make any service for that? In my application there is login/logout funda.
Help ! me please!
Yes, you need to write windows service for this. You would get lots of good articles on CP for this.
|
|
|
|
|
Thanks prasad
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
I added one edit control in my dialog. I restricted to number only. It is a normal edit box. In properties I made it to number only. In normal key press event user can not enter other than numbers. But when i given to tester, he is trying to copying the data from else where and pasteing in this edit box. Any simple way to restrict this copy and paste one. (Other than creating our own deriving CCustomEdit). any clues friends...
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
You can try EN_CHANGE or EN_UPDATE to validate the text in the control
Do your Duty and Don't expect the Result
|
|
|
|
|
Thanks it is working fine. Done . I used EN_UPDATE.
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
I am making a dialog based project in VC++ and in my form in one edit box
i want to ckeck that the mail id entered by user correct or not.
for this i write the code below.
Please tell me what function i have to use for that.
CString sMail;
GetDlgItemText(IDC_EDIT_EMAIL,sMail);
if( (!strcmp(sMail,"")) ||! strcmp("^[A-Za-z0-9\_-]+@[A-Za-z0-9\_-]+.[A-Za-z0-9\_-]+.*", sMail))
{
MessageBox("please enter valid Email");
}
Please told me here i am using function strcmp for matching alphabetic characters is correct or not.
mailing me
Yogi
|
|
|
|
|
If user enters three @ symbols how do you checking? if user enters three dots in all places how do u check?
Nice talking to you. If you judge people, you have no time to love them. -- Mother Teresa
|
|
|
|
|
yogikaushik wrote: strcmp("^[A-Za-z0-9\_-]+@[A-Za-z0-9\_-]+.[A-Za-z0-9\_-]+.*", sMail))
You cannot use strcmp like this..
the string given inside the quotes will be taken as such, i.e., strcmp has no intelligence to interpret your logic here.
Better you can find different parts of email and check it for unacceptable chars in it.
Many string functions are available, say strchr or CString::Find(..),..
Do your Duty and Don't expect the Result
|
|
|
|
|
what should be code for resizing the image drawn(zoom in and zoom out)drawing in pixels
Problems are to be solve
|
|
|
|
|
kindd wrote: code for resizing the image drawn(zoom in and zoom out)
Redraw the image with desired size.
Say you have drawn the image 50,50 - 100,100
-- then to zoom in, draw the same image from 40,40 - 110,100
-- to zoom out, draw the same image from 60,60 - 90,90
You can use, BitBlt or StretchBlt from CDC class
or
DrawImage from GDI+ Image Class
Hope i understood your question...
Do your Duty and Don't expect the Result
|
|
|
|
|
for a map to view clear by zoom in and zoom out, any thing further that helps in coding?
nill
|
|
|
|
|
kindd wrote: map to view clear by zoom in and zoom out
Use CDC::StretchBlt
Say pBitmap is your map and dc is your DC then,
CDC cdc; cdc.CreateCompatibleDC(&dc);
CBitmap* pOldBitmap = cdc.SelectObject(pBitmap);
dc.StretchBlt(x, y, width, height, &cdc, sx, sy, swidth, sheight, SRCCOPY);
cdc.SelectObject(pOldBirmap);
cdc.DeletcDC();
Here x,y,width,height are your destination rect, it will remain same for both zoom in and zoom out.But sx,sy,swidth,sheight are your source and it will vary for zoom in and zoom out and the specified source rect is what you have to zoom in/out...
Do your Duty and Don't expect the Result
|
|
|
|