Tclauncher
C:/Tclauncher. exe
2019-03-29 17:22

MFC 文件操作出现 an unnamed file contains a n ivvalid path 实在没钱了 求救

  • c++

图片说明
其中m _ ppp 是哪个编辑框的cstring变量
以下是哪个按钮的clicked函数

```void CFileDlg::OnButton1()
{
// TODO: Add your control notification handler code here
char writeBuffer[500];

char readBuffer[500];

LONGLONG lOff = 0;

CFile file(m_ppp, CFile::modeCreate | CFile::modeReadWrite);   


memset(writeBuffer, 'c', sizeof(writeBuffer));   

file.Write(writeBuffer, sizeof(writeBuffer));   

while (true)   
{   

    file.Seek(lOff, CFile::begin);   

    int nRet = file.Read(readBuffer + lOff, 100);   

    lOff += nRet;   

    if (nRet < 100)   
        break;   
}   


file.Close();

}

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

1条回答