|
biCompression=808596553
biSizeImage=38016
and other values are equal to your given/
|
|
|
|
|
Right - you need to display that bitmap data? If so, it needs to be decompressed to a
displayable format.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Yes,I should display it.Because one divece on a computer capture such data and translate to another to show.
But I don't know how to decompress the data.
|
|
|
|
|
Since you are using VFW, probably the easiest way to decompress the frames is with the
Video Compression Manager[^]. The section "Using the Video Compression Manager[^]"
documents the necessary steps and has sample code for each step.
I'm not sure if an I420 codec comes with Windows or if you need a third-party one. If you have a
codec that isn't a VCM codec you could use that of course
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
If I declaration a string like this:
<br />
char str[8] = {0};<br />
<br />
cout << sizeof(str) << endl;
But if I use new expression created a string in heap, for example
<br />
char* s = new char[8];<br />
<br />
cout << sizeof(s) << endl; <br />
So, how can get the size of string by use the new expression? Thanks!
|
|
|
|
|
try _msize() function.
nave
|
|
|
|
|
_msize is not standard. This may or may not be an issue.
Steve
|
|
|
|
|
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
|
|
|
|