|
Hello Pradeep,
Take properties and change combo type to "Drop List".
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
ya thanks for ur answer...
may i know how can i read registry values.....
please do"nt mind im beginner in MFC
modified on Wednesday, March 11, 2009 10:21 AM
|
|
|
|
|
Here you go[^]
---
"Man will never be free until the last king is strangled with the entrails of the last priest". -- Denis Diderot
|
|
|
|
|
I want to retrive the data from the end in a map.
Generally for retriving we write below code for getting data from begining.
so please suggest how can we get the data from the end in a map???
map<int,cstring>::iterator itera;
for(itera = m_mapFinalSortVirusData.begin();itera != m_mapFinalSortVirusData.end();itera++)
{
int nCount= itera->;first;
CString strvirname = itera->;second;
CString str = "";
str.Format("%d %s",nCount,strvirname);
AfxMessageBox(str);
}
|
|
|
|
|
see here [^].
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Not exactly correct: when iterating in reverse mode, you should replace the usual begin() by rbegin() and the usual end() by rend(). Thus rend doesn't return you the last element in your map but point before the first element.
|
|
|
|
|
Check out the example in the linked page.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Use a reverse iterator: it is the same principle as an iterator, except that it starts from the end of the container. You have to use the rbegin function (which returns the begining of the reverted map, aka the end of your original map).
|
|
|
|
|
brucewayn wrote: so please suggest how can we get the data from the end in a map???
What about something like:
itera = m_mapFinalSortVirusData.end();
itera--;
int nCount= itera->first;
CString strvirname = itera->second;
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
Hello brucewayn,
Is your logic dependent on the order of inserted items in map? I just want to tell you that, unlink other containers such as vector, list etc, there is no order for the inserted item in map. So be careful.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
How to calculate total line number of a text file?
I have a text file. I want to get the total line number of it. Could somebody know which function should I use? Or I should write the counting code for each line?
|
|
|
|
|
akira32 wrote: Or I should write the counting code for each line?
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Oh Pallini your answer is very mp3.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hamid. wrote: mp3.
Do you mean concise, if I guess well.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
That's right but we tell mp3 or (new version mp4 )(I thought you know it,why you dont know you need a travel to my country ).
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hamid. wrote: why you dont know you need a travel to my country
Yours is a wonderful Country, I would like very much to travel to.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Best time is spring you can see four seasons at this time the south is warm the north west is cold the center is moderate(almost) and the north is sultry.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
You could open the file and read each character to see if it is a newline. This is not very efficient because of disk I/O but it will handle very large files. You could also read the entire file into a buffer and then read through the buffer counting newline characters. This is more efficient because disk I/O is done once, but it will not handle very large files. There are also functions that will read lines from files (they know internally to read to the next newline) so you could just count how many times a line is read.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Or he could do the "inbetween" solution, create a buffer of some size and read as much of the file into it as he can, start counting and when he runs out of the buffer he can read more of the file in and continue with the same buffer starting from its beginning. This is much much much faster than reading char by char or line by line even, it will handle large files, but it won't eat up every bit of memory it finds hanging around the data bus "just chillin', wathching the game, having a beer".
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
You need to read line by line on the text files.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
You could try this:
std::ifstream myFile("a.cpp");
int count = 0;
std::string s;
while (std::getline(myFile, s))
++count;
although I suspect this (counting the line-feed characters in the file) is slightly better:
std::ifstream myFile("a.cpp", std::ios::binary);
myFile >> std::noskipws;
std::cout << 1+std::count(std::istream_iterator<char>(myFile), std::istream_iterator<char>(), (char)10) << std::endl;
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
hallo to all,
i have an SDI-MFC application which is divided by a CSplitterWnd object to 2 parts, the upper part for input text and the lower part for the output text, i need to be able to print out the content of both parts individually. I treid to use the OnPrint() and OnPrintFile(), but both are protected members. Any help to solve this problem will be appriciated. Please explain or give a link to a site that explain in details. Thanks.
|
|
|
|
|
Since you have two CView -derived classes, and OnPrint() is a virtual function, you should be able to override it in each view.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|