Edit box does not display output
Posted on 1998-11-05
I have an Edit box which is part of a dialog box.
What I am trying to achieve is to read some data from a file and then to display some of the contents back to the edit boxes I have. I have no trouble when displaying numbers in other edit boxes. But when trying to display strings, then it stays blanks.
In the example below, the variable attached to the Edit box is a CString. Please find below the code used:
fstream InpFil("C:\\Tads\\DPRM files\\MDRYieldCurvesCcy.HKD.01",ios::in);
InpFil >> FirstInt >> MOrYLetter >> CashOrSwap >> From >> Hyphen >> To;
m_HkdInstru1 = CashOrSwap.c_str();
//m_HkdInstru1 is the CString variable attached to the edit box
If I just write m_HkdInstru = "fwebfweub";
then the garbage "fwebfweub" will be displayed correctly.
I am not sure what is happening !
So can anyone provide me with a solution to display my string variable in my CString edit box ?