贴一下代码:
void CMFCApplication13Dlg::OnBnClickedButton1()
{CString cstr;
GetDlgItem(IDC_ADDRESSEDIT)->GetWindowText(cstr);
cstr.Replace(L"\\",L"\\\\");
char* charFile1 = (char*)cstr.GetBuffer(cstr.GetLength());
cstr.Replace(L"DEM",L"result");
char* charFile2 = (char*)cstr.GetBuffer(cstr.GetLength());
compute_sx a;
a.do_compute(charFile1,charFile2);
//compute_sx a;
//a.do_compute("D:\\数字地面模型\\DEM.txt","D:\\数字地面模型\\result.txt");
}
用注释的部分就不会出现问题,但我想实现读取IDC_ADDRESSEDIT里的路径来打开文件,而不是用注释里的指定路径,求大神们给解答一下!