Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Is the afxmessagebox ( ) function a mfc function?


Asked by Jeremiah McMahon on Dec 07, 2021 FAQ



AfxMessageBox is an MFC function. In a non-MFC app, use the MessageBox API function. Thank you for your help. What about GetFileSize () ? Can you post that as a separate question please? That way the QA thread will remain lucid and associated with a single topic for anyone searching for the same thing in future. Thanks.
In addition,
The AfxMessageBox()function is overloaded with two versions whose syntaxes are: int AfxMessageBox(LPCTSTR lpszText, UINT nType= MB_OK, UINT nIDHelp= 0); int AFXAPI AfxMessageBox(UINT nIDPrompt, UINT nType= MB_OK, UINT nIDHelp= (UINT) -1); Based on the above functions, a message box can be illustrated as follows:
Additionally, Although this function is global, its scope is limited to MFC applications. This means that you can use the Win32's global MessageBox()function with any compiler used on the Microsoft Windows operating systems but you cannot use the MFC's global AfxMessageBox()function with any compiler other Visual C++.
Next,
MessageBox function (winuser.h) 12/05/2018; 7 minutes to read; In this article. Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information. The message box returns an integer value that indicates which button the user clicked. Syntax
In this manner,
The message box returns an integer value that indicates which button the user clicked.