|
Hi
Read the Default section of .ini file and get the string in CString or LPCTSTR = lpszStr;
Now implement the following in your OnInitDialog()
int lastselection = m_combo.FindString(0,lpszStr);
m_combo.SetCurSel(lastselection);
redindian
|
|
|
|
|
Hi
1) Read your ini file and load the default string in CString str or LPCTSTR str;
2) implement the following in your OnInitDialog
int lastselection = m_combo.FindString(0,lpszStr);
m_combo.SetCurSel(lastselection);
redindian
|
|
|
|
|
|
dharani wrote: Do not follow Monty's advise he is confused .
hahaha now i understand him ..... he want the last item to be selected again .. damn
Gas prices suggest that they have taken out lead from gas and replaced it with gold
|
|
|
|
|
Well you will have to Owner draw the combobox yourself, lots of articles on owner draw on CP use search.
Then it comes to be that the soothing light at the end of your tunnel
Is just a freight train coming your way
|
|
|
|
|
After you have added all the items to the combobox, call SelectString() with the one you want selected.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I want to resize a BMP image and save it.
How can i do it ?
|
|
|
|
|
Well take a look at CImage[^] class it does everything you need
Excuse is a word that human beings came up with to hide from the potential of failure and in doing have robbed themselves of the grace of success.
Code-frog in lounge
|
|
|
|
|
|
Dear All,
How can i edit WM_CLOSE and WM_DESTORY Message Event handler in my dialog based application ?
Kindly Help me
Thanks
|
|
|
|
|
hi friend,
pls let me know your actual requirement.
|
|
|
|
|
Which IDE you are using?
In caseof VS2005, you need to dilog class from class view right click on its properties, and then add/edit required message/overidables.
|
|
|
|
|
Hello
GO to class wizard ->Object IDs as your dialog class ->"Add Function" for WM_CLOSE /WM_DESTROY And edit the code in ~dlg.cpp
redindian
|
|
|
|
|
In the properties window you can declare their on your program Is it your purpose?
|
|
|
|
|
I would like to know how to detect the socket was blocked?
Also how to detect the network is disabled?
Please help!
|
|
|
|
|
Connect... and see if it returns with an error or if the connect attempt times out.
|
|
|
|
|
hey guys,
I was wondering what the most efficient way of finding the number of occurences in a list is.
Say I have a list....
struct data{
int number;
int occurences;
};
data list[7];
list[0].number = 5;
list[1].number = 6;
list[2].number = 6;
list[3].number = 8;
list[4].number = 9;
list[5].number = 9;
list[6].number = 9;
how would i sort in such a way that I eliminate the numbers that occur more than once like this,
list[0].number = 5;
list[1].number = 6;
list[2].number = 8;
list[3].number = 9;
and saves the number of occurence for each number
list[0].occurences = 1;
list[1].occurences = 2;
list[2].occurences = 1;
list[3].occurences = 3;
I thought of every possible way,
I can do it for numbers that appear twice but three times, i duno how to deal with it.....
Someone please help me out
|
|
|
|
|
Why did you use the name 'list' for a variable which is an array ?
Could you post your current algorithm to correct it ?
|
|
|
|
|
Am i missing soemthing? Why not call an array a list, thats basically what it is.
|
|
|
|
|
The Undefeated wrote: Why not call an array a list, thats basically what it is.
I'd like to be shown where 'Array' publically derives from ("is-a") 'List'.
Also, in C++, 'Array' has the distinct connotation of 'contiguous memory'.
A 'List' has definitly not. If he would have called his std:vector 'Array'...
While on a very zoomed-out, global point of wiew you are right, for a beginner it is definitely better to separate the concepts of the two container types.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
If you can use an STL container, do so and then you can use the sort and unique methods.
|
|
|
|
|
Make a new array for the initial list of numbers then
use a for loop to start adding the numbers to the array, use an embedded for loop to check whether the number has already been added.
for(int i=0; l <7; i++) {<br />
<br />
list[i].number = 0;<br />
list[i].occurences = 0;<br />
<br />
}<br />
int ListIndex = 0;<br />
<br />
for(i=0; i <7; i++) {<br />
<br />
int index = i;<br />
bool IsRepeat = false;<br />
<br />
for(int j=0; j <7; j++) {<br />
<br />
if(array[index] == list[j].number) {<br />
<br />
IsRepeat = true;<br />
list[j].occurences++;<br />
}<br />
}<br />
<br />
if(!IsRepeat) {<br />
<br />
list[ListIndex].number = array[i];<br />
list[ListIndex].occurences = 1;<br />
ListIndex++;<br />
}<br />
}
I just stuck that togeather now, if it don't work, then don't complain about it
-- modified at 6:27 Friday 10th November, 2006
The code does work, im so happy
|
|
|
|
|
thanks, thats great
i got a bit confused when I first saw your code, but.......
it works!!!
THANKS !!!!!!!
|
|
|
|
|
Just so long as you make sure you understand it, all will be good
|
|
|
|
|
hi,
i want to know how to load a bitmap on to a dialog without loss of color?
thanks
|
|
|
|