0

I am developing an MFC application. The UI will contain a Listbox with multiple options. Each selection in the list box has a respective function to be executed. I have written event handlers for doubleclick of the listbox selections.

There are few scenarios in each function where in I may have to display a few messages and a few values (just like how we do with printf).

I would like to know how to achieve this with EditControl. I want these messages to appear in the EditControl.

Bo Persson
  • 90,663
  • 31
  • 146
  • 203
yashu
  • 29
  • 1
  • 6
  • Pass to the code doing the work a pointer to the dialog, so that you can call an appropriate public dialog function to populate the controls. Or add more information if the design is more complex ??? – acraig5075 May 17 '12 at 08:22

1 Answers1

1

I might have missed the point here but can you not use a CString and the Format function to setup the string before displaying it?

Stefan
  • 3,669
  • 2
  • 32
  • 43
  • I did try that but dint help me much – yashu May 17 '12 at 09:30
  • Could you be a bit more specific? What exactly did it not do that you need? It does everything that printf does. – Stefan May 17 '12 at 10:38
  • I did use this, but In output i got few junk values... a쳌쳌쳌쳌쳌쳌쳌쳌쳌쳌쳌쳌쳌쳌쳌쳌쳌 : identifier instead of a: identifier Here a is a char array – yashu May 17 '12 at 13:55
  • 1
    Got the answer.. The issue was the ANSI-Unicode conversions.I had declared an array in ANSI and was using it with str.Format so changing the declared array to Unicode helped me in solving the problem – yashu May 18 '12 at 07:51
  • Ah, yes that would do it. Good spot. – Stefan May 18 '12 at 08:25