How make in MFC C++:
i need a function, the function has read a txt file and put a message box with text which is in txt file.

How make in MFC C++:
i need a function, the function has read a txt file and put a message box with text which is in txt file.

Below is one way of doing it

void some_function()
{
    CStdioFile File;
    CString strLine;
    CString strMsg;

    if(File.Open("file.txt", CFile::modeRead))
    {
        while(File.ReadString(strLine))
        {
            strMsg += strLine + '\n';
        }
    }

    AfxMessageBox(strMsg, MB_ICONINFORMATION);
}