|
yes,I already tried it.But getting "memory could not be read "error.
Thank you
Siddharth
|
|
|
|
|
Can you show your code how do you use?
|
|
|
|
|
Hi,
Why don't u create an data member for thar Edit box (Category as Value and type as int)in MFC class wizard.This will get u the integer value by the statement UpdateData();
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
Hi Everyone,
In my application I used directdraw to play the media files like MPEG,MPEG2,etc..,in that while loading the files I want the duration of the files in list control while adding it in the List itself. How to get the duration of the files while loading in the playlist before playing the file.
Looking forward for your reply
with regards,
Ganesh
|
|
|
|
|
Hi all,
i Have a problem regarding multithreading....
Actually i am having a list control in that list control i having 2 columns one contaning url value n other for displaying result....
this i have done through making a class for ping which is derieved from CWinThread class...
if i run a single class then the result displayed in the list control column is correct but instead if i select more than 1 value then the result displayed is same (both rows contain same value). But the value calculated for ping is correct..problem is in displaying it in listctrl..
for sending messeage i have used SendMessage function .
Can anybody help me in this...
thanks in advance
|
|
|
|
|
neha.agarwal27 wrote: for sending messeage i have used SendMessage function .
Your secondary thread should not be sending messages directly to the list control (which belongs to the primary thread). Post a message to the primary thread instead, and let it update its controls. See here for more.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi
I have a homework about finding amicable numbers
[[[[
Amicable numbers:Two numbers are called Amicable(or friendly)if each equals to the sum of the aliquot divisors
of the other.Aliquot divisors mean all the divisors excluding the number itself. For example,
aliquot divisors of number 220 are 1,2,4,5,10,11,20,22,44,55 and 110. The aliquot divisors of number 284 are 1,2,4,71 and 142.
If we represent anamicable pair by(m,n)and sum of aliquot divisors of m and n by(m)and(n)respectively,then for amicable pair(220,284)we get
(m)=(220)=1+2+4+5+10+11+20+22+44+55+110=284=n
(n)=(284)=1+2+4+71+142=220=m
]]]]
my teacher wanted this programs code in C++ without using any arrays(we are allowed to do this with if,while,for,do while).And also the program must be like this:
220 and 284 are amicable numbers.
Number of amicable number less than 1000 is 1.
1184 and 1210 are amicable numbers.
2620 and 2924 are amicable numbers.
5020 and 5564 are amicable numbers.
6232 and 6368 are amicable numbers.
Number of amicable number less than 10000 is 5.
....
....
....
....
It must survive up to 10^10.
Please help me,I will so appreciate...
|
|
|
|
|
I'll point you in the right direction to help you do it yourself.
First off you clearly need a function to compute the aliquot divisor of a number.
Second you need to decide how to find the pairs. (assume that you need to detect/avoid duplicates) I think a simple loop can handle this problem.
You need to go through the thought process. You can get help for that here - maybe.
|
|
|
|
|
I cannot do it by myself.I found these codes in this site but it has an array like int get_sumf(int val).We are not allowed to do that.How can I do it without ant array???
#include <stdio.h>
#define MAX 10000000000
int get_sumf(int val)
{
int sum = 1;
int k;
for (k = 2; k <= val / 2; ++k)
if (val % k == 0)
sum += k;
return sum;
}
int main()
{
int i, k;
for (i = 2; i < MAX; ++i) {
int val = get_sumf(i);
for (k = 0; k < i; ++k)
if (val == k && get_sumf(k) == i)
printf("%d %d\n", i, k);
}
return 0;
}
|
|
|
|
|
sugaragga wrote: Please help me...
Exactly which part do you need help with? What code do you have in place so far? What doesn't work?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
how can I insert these informations:
"Number of amicable number less than 1000 is 1."
"Number of amicable number less than 10000 is 5."
like this:
"220 and 284 are amicable numbers.
Number of amicable number less than 1000 is 1.
1184 and 1210 are amicable numbers.
2620 and 2924 are amicable numbers.
5020 and 5564 are amicable numbers.
6232 and 6368 are amicable numbers.
Number of amicable number less than 10000 is 5."
.
I can only write these numbers like:
220 284
1184 1210
2620 2924
5020 5564
6232 6368
....
....
Please help me
|
|
|
|
|
I Have developed a project thru Vc++ 7.0. I have used a ocx MSHFlexgrid. Incase i have to upload my project into clients machine where Vc++ 7.0 is not present, then the MSHFlexGrid does not get displayed. Can u provide some solution to this.. if so please email it on praveena@navayuga.co.in /or can u guide me for the same..
Thks
Praveen a.
praveena@navayuga.co.in
|
|
|
|
|
Is the ocx registered on the client machines?
|
|
|
|
|
how to change tab text color in tab control.give samples plz.
|
|
|
|
|
you need to make an owner draw tab control
http://www.codeproject.com/tabctrl/customtab.asp
if u didnt understand the code let me know
|
|
|
|
|
i want to give color to tab caption for each tab in that control.like,if a tab control have two tabs like tab1 and tab2.am want to change tab1 & tab2 to colored one.how to do this.
|
|
|
|
|
see this code
void CEnTabCtrl::DrawItem(LPDRAWITEMSTRUCT lpdis)
{
TC_ITEM tci;
CDC* pDC = CDC::FromHandle(lpdis->hDC);
HIMAGELIST hilTabs = (HIMAGELIST)TabCtrl_GetImageList(GetSafeHwnd());
BOOL bSelected = (lpdis->itemID == (UINT)GetCurSel());
BOOL bColor = (s_dwCustomLook & ETC_COLOR);
CRect rItem(lpdis->rcItem);
if (bSelected)
rItem.bottom -= 1;
else
rItem.bottom += 2;
// tab
// blend from back color to COLOR_3DFACE if 16 bit mode or better
COLORREF crFrom = GetTabColor(bSelected);
if (s_dwCustomLook & ETC_GRADIENT && pDC->GetDeviceCaps(BITSPIXEL) >= 16)
{
COLORREF crTo = bSelected ? ::GetSysColor(COLOR_3DFACE) : Darker(!bColor || m_crBack == -1 ? ::GetSysColor(COLOR_3DFACE) : m_crBack, 0.7f);
int nROrg = GetRValue(crFrom);
int nGOrg = GetGValue(crFrom);
int nBOrg = GetBValue(crFrom);
int nRDiff = GetRValue(crTo) - nROrg;
int nGDiff = GetGValue(crTo) - nGOrg;
int nBDiff = GetBValue(crTo) - nBOrg;
int nHeight = rItem.Height();
for (int nLine = 0; nLine < nHeight; nLine += 2)
{
int nRed = nROrg + (nLine * nRDiff) / nHeight;
int nGreen = nGOrg + (nLine * nGDiff) / nHeight;
int nBlue = nBOrg + (nLine * nBDiff) / nHeight;
pDC->FillSolidRect(CRect(rItem.left, rItem.top + nLine, rItem.right, rItem.top + nLine + 2),
RGB(nRed, nGreen, nBlue));
}
}
else // simple solid fill
pDC->FillSolidRect(rItem, crFrom);
// text & icon
rItem.left += PADDING;
rItem.top += PADDING + (bSelected ? 1 : 0);
pDC->SetBkMode(TRANSPARENT);
CString sTemp;
tci.mask = TCIF_TEXT | TCIF_IMAGE;
tci.pszText = sTemp.GetBuffer(100);
tci.cchTextMax = 99;
GetItem(lpdis->itemID, &tci);
sTemp.ReleaseBuffer();
// icon
if (hilTabs)
{
ImageList_Draw(hilTabs, tci.iImage, *pDC, rItem.left, rItem.top, ILD_TRANSPARENT);
rItem.left += 16 + PADDING;
}
// text
rItem.right -= PADDING;
FormatText(sTemp, pDC, rItem.Width());
COLORREF col;
col=RGB(255,0,0);
pDC->SetTextColor(col);
pDC->DrawText(sTemp, rItem, DT_NOPREFIX | DT_CENTER);
}
|
|
|
|
|
Hi,
I am designing an editor in C#. for example in searching for a text(Find)
when the searching text is found it should be highlighted.One more think,
i want to implement line number functionality in my editor.i dont know how
to do .
Please if any one knows help me.
With Thanks
Sakthi
|
|
|
|
|
|
SakthiSurya wrote: I am designing an editor in C#.
Wouldn't you think your question would be better suited here?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Only a thought: can you use a predesigned editor? you can always attach the scintilla DLL inside your project and then you would have a lot of power without almost effort inside your app.
Hope this helps.
|
|
|
|
|
My Listview control is working fine but it add item at first position in the listview(other shift below)I want it to add the item at last.
fot that what should I do?
Amit
|
|
|
|
|
You need to provide index of item to add. Can you show code you are using ?
|
|
|
|
|
Sure master!
but if i use the listview count and then according the last count i add one in the count and then try to put in the listview is it ok ?
Amit
|
|
|
|
|
You can do something like this as per your needs...
LV_ITEM lvitem;
int nIndex = -1;
lvitem.mask = LVIF_TEXT;
lvitem.iItem = i;
lvitem.pszText = "";
lvitem.iSubItem = 0;
lvitem.state = 0;
nIndex=m_ListCtrl .InsertItem(&lvitem);
i++;
CString str;
str.Format("%d",i);
m_ListCtrl.SetItemText (nIndex,0,str);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|