我的问题怎么这么难解决,难道是分少了,我现在给100,不够再给……
1)怎么还是会读出乱码:请给出正确代码。
void CSTRDIALOG::OnButton2()
{
// TODO: Add your control notification handler code here
m_List1.ResetContent();
int nCount = m_Edit2.GetLineCount();
int sLength;
CString strLine, strText;
for(int i=0;i<nCount;i++)
{
strLine = strText = "";
sLength = m_Edit2.LineLength(i);
afxDump << sLength << "\t";
m_Edit2.GetLine(i,strLine.GetBuffer(sLength),sLength);
strLine.ReleaseBuffer(sLength);
strText.Format("%s",strLine);
strText.TrimLeft();
strText.TrimRight();
if (strText!="") m_List1.AddString(strText);
}
}
2)怎样使一个COMBOBOX下拉的函数为10,我怎么在COMBOBOX中填入数据,运行时总是只有2行,什么原因,如何解决?
3)这段代码代表什么意思?
void CEnumWndsDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
4)请列出一段读、写文件的代码
/*请给出正确代码,绝对给分*/