|
There's no built-in serializaton for DCs or bitmaps.
Saving a DC to a file wouldn't be of any use since the DC wouldn't be valid when read from the
file.
Probably the easiest way to save the bitmap to a file is to
1) use SelectObject() to restore the DC's original bitmap and obtain the HBITMAP for the bitmap
you want to save
2) create a CImage object
3) Use the CImage::Attach() method to attach the HBITMAP to the CImage object
4) Use CImage::Save() to save the bitmap to a file
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
How can I find the selected item index in listview???
suppose I have number of items in my list view and I have select five or six items randomly then how can I find the index of that selected items and subitems?
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Hi,
Enumerate through the items and test each one;
CListCtrl &ctrl = GetListCtrl();
for (int j = 0; j < nCount; j ++)
{
if (ctrl.GetItemState(j, LVIS_SELECTED) == LVIS_SELECTED)) {
}
}
--
=====
Arman
|
|
|
|
|
Hi!
Thanks actually i have try to do it in other way ,
following way,
but in the array I got double values for one selected item now i will go through the
steps you given.
Actually i am working on win32(unicode).
but its ok.
Thanks
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Arman Z. Sahakyan wrote: Enumerate through the items and test each one;
Maybe a bit inefficient in large lists
There's also CListCtrl::GetFirstSelectedItemPosition()/CListCtrl::GetNextSelectedItem()
(LVM_GETNEXTITEM for non-MFC) too.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Are you sure these APIs do not sequentially traverse all the elements by returning those with the specified style (e.g. selected ones)? I'm pretty sure it is so.
--
=====
Arman
|
|
|
|
|
Arman Z. Sahakyan wrote: Are you sure these APIs do not sequentially traverse all the elements by returning those with the specified style (e.g. selected ones)?
Nope, I'm not sure!
Never mind then!
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Mark Salsbery wrote: GetFirstSelectedItemPosition()/
What is Equivalent in win32????
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
amitmistry_petlad wrote: What is Equivalent in win32????
LVM_GETNEXTITEM
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
I make it so:
void CMyListView::OnItemchangedRulelist(NMHDR* pNMHDR, LRESULT* pResult)
{ NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
POSITION pos = m_clcList.GetFirstSelectedItemPosition();
while (pos)
{ int nPos = m_clcList.GetNextSelectedItem(pos);
}
*pResult = 0;
return;
}
Edit: I forgot to say that the list im using is one of the extended lists here in codeproject (i don't remember which one )
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
I need for win32(unicode). not for MFC
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
No problem,
but next time say it before, we can not read minds :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Thank you very much for your response.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Sorry to ask you.
what is M.D.V?
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
The first letters of my name hehehehe
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Hi All,
I want to read a XML file and do not want to use COM based solution.
Reason being that I want a registry independent solution.
Thanks
Suraj
|
|
|
|
|
See
CMarkup[^]
XmlLite[^]
Or search for 'Xml reader' here in codeproject
--
=====
Arman
|
|
|
|
|
Thanks for quick response.
CMarkup is a 3rd party component which probably has to be purchased.
XmlLite and XmlReader are a COM based solution, which is no no for us.
Thanks
Suraj
|
|
|
|
|
TinyXML[^] ?
Quite easy to add to your application (only a bunch of source files).
|
|
|
|
|
|
Hi to all,
I want algorithm/information about "Advanced Technology of Compression-Domain Processing" to get Macro-Block DCT Coefficients of an MPEG-2 TS without decoding and re-encoding.
OR anyone knows how to get Macro-Block DCT Coefficients of an MPEG-2 TS without decoding and re-encoding?
|
|
|
|
|
Hello all i am very new in c erra so please help me out to make c pyramid programs..
which is made by help of nesting for,while and do while loop..
I need all programs code which based on my problem ..and let me introduse any links which give me c programe code on pyramid type out put programme..
some example below..
1) Make c programme for ..
1
12
123
1234
12345
2)
Make c programme for
1
232
3443
45654
Life is not easy ,let's make it.
|
|
|
|
|
The programs that you are asking the code for are very easy and just need the logic for implementing nested loops(May be for loop). Providing the code wouldn't help you to build the logic. SO just go ahead and try to build on a logic with nested loops and you will definetly get the desired results.
1) You can start with how to print "1"
2) Print a new line
3) Print 12 and so on...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
But ansuman i need collection of such type ...programs....could u provide me..
Life is not easy ,let's make it.
|
|
|
|