|
amitmistry_petlad wrote: n Thread function or in mainthread where I had create my worker thread where ? where ? where?
isn't break point working!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
CPallini wrote: Why not?
will try [ ]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
amitmistry_petlad wrote: can I debug multithreading application?
Yes.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
|
amitmistry_petlad wrote: hi !
Hi!
amitmistry_petlad wrote: sorry to ask a question on thread.
That's okay.
amitmistry_petlad wrote: can I debug multithreading application?
Yo!
"The difficulty lies, not in the new ideas, but in escaping from the old ones."
-- John Maynard Keyes, 1936
|
|
|
|
|
Your answer is exactly to question very similar but whats meaning of "Yo"?
|
|
|
|
|
by "Yo", he meant "Ya" with a mouth getting closed... get what i mean ?
|
|
|
|
|
Hi
Can anyone tell me the difference between constant pointer and pointer to a constant. Please tell me the situation in which they are used.
Thanks in advance
|
|
|
|
|
|
ragavan wrote: difference between constant pointer and pointer to a constant
isn't what you say descriptive enough ?!
a const pointer cannot be modified, while a pointer to const points to a memory ary which is read-only
|
|
|
|
|
|
Hi
Can anyone tell me why it is necessary to overload new and delete operator
Thanks in advance
|
|
|
|
|
ragavan wrote: Can anyone tell me why it is necessary to overload new and delete operator
It is certainly not necessary to overload these operators. It can be done, sure, but it is never needed. I never did that myself (and I don't see a reason why I would do so).
An example of what you can do by overloading these operators is what MFC does: it allows to track memory leaks.
|
|
|
|
|
Well put.
It seems like the OP meant to say "when it is necessary" rather than "why it is necessary".
|
|
|
|
|
Cedric Moonen wrote: It is certainly not necessary to overload these operators. It can be done, sure, but it is never needed. I never did that myself (and I don't see a reason why I would do so).
Yikes! Please be careful saying things like this to less-experienced developers - just because you never had a reason to do so does not mean that one does not exist. :P
Cedric Moonen wrote: An example of what you can do by overloading these operators is what MFC does: it allows to track memory leaks.
Unless MFC changed recently, I believe this was mostly done by the use of DEBUG_NEW instead of new , and this in turn happened thanks to a #define that was in effect for debug builds. That is not really overloading new ...
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
James R. Twine wrote: Yikes! Please be careful saying things like this to less-experienced developers - just because you never had a reason to do so does not mean that one does not exist.
That was certainly not my intention. Maybe I expressed myself badly.
|
|
|
|
|
ragavan wrote: why it is necessary to overload new and delete operator
to put some extra printf() inside them for instance !?
|
|
|
|
|
One (the only?) reason is when the objects need to be allocated in a non-standard way. For example, for performance reasons, you may be using per-thread heaps so as to avoid heap contention in a multi-threaded application (if the application is allocation intensive).
Or if you have to allocate lots of smaller-sized objects (< 16-32 bytes) and you need to optimize the allocations by allocating larger blocks and then chunking them yourself. Combining the Win32 heap's and C-RTL's overhead, a heap allocation can have between 20-32 bytes of overhead. So if you need to allocate one million objects of 8 bytes each, this overhead (both space and execution time) can start to add up quickly.
Granted, the average everyday developer does not need to be (or simply is not) concerned with such things, but those are some reasons I have done it in the past.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi,
i have a CListView style of which is in report.
how can i get the cell which user selected?
Is it posible to change the icone used for check box ?
thanks in advance
Sourabh
sourabh
|
|
|
|
|
study.sourabh wrote: how can i get the cell which user selected?
In my XListCtrl, I have the function:
int CXListCtrl::GetCurSel()
{
POSITION pos = GetFirstSelectedItemPosition();
int nSelectedItem = -1;
if (pos != NULL)
nSelectedItem = GetNextSelectedItem(pos);
return nSelectedItem;
} Note that this returns the selected row. To find out which column was clicked, you can handle the NM_CLICK or LVN_COLUMNCLICK messages.
study.sourabh wrote: Is it posible to change the icone used for check box ?
Yes, you can handle the NM_CUSTOMDRAW message and draw your own. There are examples here on CP that will help.
Best wishes,
Hans
|
|
|
|
|
hi Hans,
Thanks for the help.
But LVN_COLUMNCLICK message will give the colem which was selected in the header of CListCtrl right?
i wanted to know to which cell in the row user selected.Is it posible to get information regarding that?
thnanks
sourabh
|
|
|
|
|
As I said, you can handle the NM_CLICK message. Here is some sample code:
void CXListCtrlTestDlg::OnClick(NMHDR* pNMHDR, LRESULT* pResult)
{
LPNMITEMACTIVATE pNMIA = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);
int nItem = -1;
int nSubItem = -1;
if (pNMIA)
{
nItem = pNMIA->iItem;
nSubItem = pNMIA->iSubItem;
}
if (nItem >= 0 && nSubItem >= 0)
{
CString strText = m_List.GetItemText(nItem, nSubItem);
Log(_T("OnClick at (%d,%d): '%s'"), nItem, nSubItem, strText);
}
*pResult = 0;
}
Best wishes,
Hans
|
|
|
|
|
Hi Hans,
Thank you very much.
It works i get the column which is clicked.
sourabh
|
|
|
|
|
I'm looking for a c/c++ solution for the following NP-completeness problem:
Write a function that gets an array of integers, its size and an integer. The function should return true if the sum of any subset of the array members is equalt to the integer. For example, if the array is 1,3,5,6 then possible sum are 4(1+3),11(5+6),9(1+3+5). If the intefger is 20 then the function returns false (no way of getting a sum higher than 15:1+3+5+6)
C Function declaration for example: bool is_subset(int* pArray,int nSize,int Sum)
MFC function declaration for example: BOOL IsSubset(const CUIntArray& Array,UINT Sum)
Thanks
|
|
|
|
|
have you already started to code something by yourself on this assignement ?
or are you a bit too lazy to expecting us to do your homework ?
also, please ask a specific question; asking for a whole job is all but what will bring you some help, because people here are not paid for helping, and get iritated by lazy questions...
|
|
|
|