|
hanlei0000000009 wrote: So, how can get the size of string by use the new expression? Thanks!
One possibility is to look at the 32 bits preceding the address returned from new . This may be what _msize() is doing internally but with some extra stuff.
"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
|
|
|
|
|
I want to capture and translate video data from one computer to another.I use VFW,but different computers and drivers surport different fomats and mode. How should I deal such difference?
BEST REGARDS
|
|
|
|
|
A couple of data blocks with BITMAPHEADER (40,176,144,1,24,0,76032,0,0,0,0)and (40,176,144,1,12,808596553,38016,0,0,0,0) . How should I display this two blocks ?
Thanks
|
|
|
|
|
See here[^]
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi,
I created a shell extension that shows a dialog(MFC). The dialog have a list control and i tried to implement the sort functionality in it. The problem is when I call the ListView_SortItems or ListView_SortItemsEx of the list control, after the first call back returned from my application an exception is coming.
Any solution for this?
Thanks
Naveen
|
|
|
|
|
Maybe posting relevant code will help.
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.
|
|
|
|
|
CPallini wrote: Maybe posting relevant code will help.
thanks.
void MainDlg::OnColumnclickList1(NMHDR* pNMHDR, LRESULT* pResult)
{
ListView_SortItemsEx( m_list.m_hWnd, CompareFunc, (LPARAM)this );
*pResult = 0;
}
int MainDlg::CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
return 1;
}
nave
|
|
|
|
|
IMHO there are two strange things in your code (but I don't know how dangerous they are):
- Why are you passing this pointer to the comparisono function (though it is perfectly legal) ?
- Your comparison function it's wrong: it cannot order a set. I know it it a test function, but try to improve it.
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.
|
|
|
|
|
CPallini wrote: Why are you passing this pointer to the comparisono function (though it is perfectly legal) ?
I removed the this pointer. Still the exception is ocurring( Actaully this code will work fine in simple mfc application. I have even tried this in an ocx )
CPallini wrote: Your comparison function it's wrong: it cannot order a set. I know it it a test function, but try to improve it.
I know the current code will not do sorting. Just for making the code shorter i have removed the comparision codes.
nave
|
|
|
|
|
Naveen R wrote: removed the this pointer. Still the exception is ocurring( Actaully this code will work fine in simple mfc application. I have even tried this in an ocx )
I expected the above behaviour. I was curious about...
Naveen R wrote: I know the current code will not do sorting. Just for making the code shorter i have removed the comparision codes.
Maybe the bug it is in the not-posted code!
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.
|
|
|
|
|
no no
Even the code that I posted causes exception. Simply returning the 1 itself is causing the exception.
nave
|
|
|
|
|
IMHO this may happen 'cause you function isn't good for ordering.
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.
|
|
|
|
|
I got the pblm solved. I missed the "CALLBACK" in the function declaration.
Thanks anyway
nave
|
|
|
|
|
Good Point!
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.
|
|
|
|
|
Didn't get time to look into your code. Will do soon.
|
|
|
|
|
Hi Nibu,
pblm solved. The pblm was I didnt put the "CALLBACK" in the function declaration. Thats all.
Thanks anyway.
nave
|
|
|
|
|
Naveen R wrote: The pblm was I didnt put the "CALLBACK" in the function declaration.
Hmm Nice fix.
|
|
|
|
|
Hi,
plz help me...i want to make an application in which i want to Show Different desired row color in List Control using CListCtrl class member.but i'm unable to get the same result.plz help me on my application.
Thanks in advance
Pankaj Jain
|
|
|
|
|
I think you need to handle the custom draw( NM_CUSTOMDRAW) in list control.
nave
|
|
|
|
|
|
|
I need small suggession on designing my application.
I have a dialog. On clicking a button on dialog calls a thread which copies some files from one location to another specified location on the local system. Now i want to show the copying status of that files in another dialog like windows os shows while copying.
How to accomplish this.
Should I call another thread showing the dialog and details from the dialog.
What is the better process.
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: Should I call another thread showing the dialog and details from the dialog.
Yes.
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.
|
|
|
|
|
Do you really have to spawn a new thread for this?
It depends on how you want your application to react, but you haven't said anything about that yet.
What I'm thinking about is this:
Your dialog box receives some user input that presumably is used for starting the copying process. When the user desires to start the copying process the dialog could probably be dismissed, or simply create another dialog on top of the first one to handle progress information about the copying process. Call ::CopyFileEx() and provide a function pointer to a callback that will be called for updating the progress of the copying process for each file. Inside this callback you can update a progress bar or whatever information you want to show the user.
When the last file has been copied you simply close the progress information dialog and revert to the old dialog, or whatever GUI is beneath it.
This will keep everything in one single thread, the files will be copied and the user notified about the progress.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I have created a class that encapsulates the open session, open request, send request, read response until buffers are empty and the closes the connections. When I create the first instance, everything work perfectly. I then destroy the object and create another object. This time everything seems to be working fine until the code hits the HttpSendRequest routine. At this point it hangs and never returns. All routines and parameters before the call were successful and had valid values. I have noticed a number of other posts related to this but not answers. Any ideas? pls help me
-- modified at 2:51 Friday 25th May, 2007
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|