FILE *fPtr = fopen(fullFileName, "r"); //fullFileName是文件全名(包括路径和后缀)
if(!fPtr)
{
return;
}
int size = 1000; //size要足够容纳你所要显示的文本;
char text[size];
if(fscanf(fPtr, "%s", text)== -1)
{
fclose(fPtr);
return;
}
fclose(fPtr);
CString editboxText = _T(text);
GetDlgItem(ID_EDIT_BOX)->SetWindowText(editboxText); //ID_EDIT_BOX为editbox的ID