Click here to Skip to main content
15,909,645 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC going by wayside? Pin
Blueapples27-Jun-03 12:03
Blueapples27-Jun-03 12:03 
GeneralRe: MFC going by wayside? Pin
NormDroid28-Jun-03 1:59
professionalNormDroid28-Jun-03 1:59 
GeneralRe: MFC going by wayside? Pin
Nick Parker28-Jun-03 6:39
protectorNick Parker28-Jun-03 6:39 
AnswerRe: MFC going by wayside? Pin
Ryan Binns27-Jun-03 17:08
Ryan Binns27-Jun-03 17:08 
GeneralDirectX directdraw, tiles... Pin
Kuniva27-Jun-03 7:50
Kuniva27-Jun-03 7:50 
GeneralRe: DirectX directdraw, tiles... Pin
ZoogieZork28-Jun-03 7:21
ZoogieZork28-Jun-03 7:21 
GeneralRe: DirectX directdraw, tiles... Pin
Kuniva28-Jun-03 12:01
Kuniva28-Jun-03 12:01 
GeneralSetCurSel and GetCurSel() in MFC Pin
keegan27-Jun-03 7:12
keegan27-Jun-03 7:12 
Harumph. i've got a bit of code here that is suposed to read data from a text file, and based on the value of 'default_val' its supposed to make the string in my combobox display that is linked to a number.

ie, if default_val = 0, then the first string displays, 1 the 2nd string, etc

here's my code:

<br />
combovectorread( strings, var_nums, pointer, default_val);<br />
	<br />
DDX_Control(pDX, IDC_INPUT_TQ, input_tq);<br />
input_tq.SetCurSel(default_val);<br />
<br />
<br />
for(int i = 0; i <= var_nums; i++)<br />
{<br />
	input_tq.AddString(strings.at(i).c_str());<br />
}<br />
<br />
<br />
combovectorwrite(pointer, default_val);


here's what everything does: combovectorread() gets a vector fo strings (contents of the listbox), default_val is the number of the string i want to be default in the combobox. input_tq is my CComboBox object. combovectorwrite() outputs the value of default_val to teh text file.

Now, everything works fine when a user changes the selected string in the combo box. if they select, say, string 3, and move to another tab in the propertysheet, string3 remains selected. however, if they close the program and reload it, its back to the origional.

any suggestions? i know the input/output work properly, i've tested them and output to teh screen. I think my main question is finding where in the source code i need to have a GetCurSel(). I tried putting it before the combovectorwrite() and setting default_value to it, but it always sets default_val = -1. even if the 3rd string is selected.

*.*
GeneralRe: SetCurSel and GetCurSel() in MFC Pin
David Crow27-Jun-03 8:50
David Crow27-Jun-03 8:50 
GeneralRe: SetCurSel and GetCurSel() in MFC Pin
keegan27-Jun-03 9:26
keegan27-Jun-03 9:26 
GeneralRe: SetCurSel and GetCurSel() in MFC Pin
basementman27-Jun-03 9:46
basementman27-Jun-03 9:46 
GeneralRe: SetCurSel and GetCurSel() in MFC Pin
keegan27-Jun-03 10:05
keegan27-Jun-03 10:05 
GeneralRe: SetCurSel and GetCurSel() in MFC Pin
David Crow27-Jun-03 10:10
David Crow27-Jun-03 10:10 
GeneralRe: SetCurSel and GetCurSel() in MFC Pin
keegan27-Jun-03 10:22
keegan27-Jun-03 10:22 
GeneralRe: SetCurSel and GetCurSel() in MFC Pin
David Crow27-Jun-03 10:25
David Crow27-Jun-03 10:25 
Questionhow to use the esc key to stop a program Pin
johnstonsk27-Jun-03 6:43
johnstonsk27-Jun-03 6:43 
AnswerRe: how to use the esc key to stop a program Pin
keegan27-Jun-03 7:22
keegan27-Jun-03 7:22 
GeneralRe: how to use the esc key to stop a program Pin
johnstonsk27-Jun-03 7:37
johnstonsk27-Jun-03 7:37 
GeneralRe: how to use the esc key to stop a program Pin
keegan27-Jun-03 7:44
keegan27-Jun-03 7:44 
GeneralRe: how to use the esc key to stop a program Pin
johnstonsk27-Jun-03 8:30
johnstonsk27-Jun-03 8:30 
GeneralRe: how to use the esc key to stop a program Pin
keegan27-Jun-03 8:39
keegan27-Jun-03 8:39 
GeneralDLL entry point problem Pin
Andy H27-Jun-03 6:12
Andy H27-Jun-03 6:12 
GeneralRe: DLL entry point problem Pin
Peter Weyzen27-Jun-03 7:22
Peter Weyzen27-Jun-03 7:22 
GeneralProperty Page OnNotify question Pin
skinnyreptile27-Jun-03 6:03
skinnyreptile27-Jun-03 6:03 
GeneralRe: Property Page OnNotify question Pin
valikac27-Jun-03 6:07
valikac27-Jun-03 6:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.