|
not standard?Why you say so?Can u pls explain?
nave
|
|
|
|
|
Probably because of the leading underscore.
"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
|
|
|
|
|
Do a Google search for _msize standard[^] and you'll find plenty of info. Essentially it's not officially part of C++.
Steve
|
|
|
|
|
hi steve,
None of them specifies about the _msize() implementation in vc++. And I know how this is implemented in vc++ 6( you can find it out just by steping into the CRT codes ). Please check it and then tell me is there any thing wrong in using it.
nave
|
|
|
|
|
As far as I know there is no problem with using it. I don't use it myself and never would so I can't guarantee this. If all you care about is MSVC then the fact that it’s non-standard will not concern you.
Steve
|
|
|
|
|
Why not simply use strlen ? If this is a standard NULL terminated string, that's the way to go.
EDIT: I just saw the answer of Naveen and I'm wondering what you want to know exactly: the number of characters in the string (it will stop at the NULL termination wihtout counting it) or the size of the memory block allocated ? For the latter, then check the post of Naveen.
|
|
|
|
|
My compiler is Visual C++ 6.0. This compiler can use the _msize function.
Now, my problem has been solved.
|
|
|
|
|
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
|
|
|
|