CString strMessage; strMessage.LoadStringW(IDS_HELLO_STRING);
CString strError; strError.LoadStringW(IDS_ERROR_MESSAGE); AfxMessageBox(strError);In this example, the function is used to load an error message string with ID "IDS_ERROR_MESSAGE". The returned string is displayed in a message box using the MFC function "AfxMessageBox". Package Library: This function is part of the CString class in the MFC (Microsoft Foundation Class) library of C++.