Step 4 − As you can see that Create() method needs two parameters, the name of the class, which should be passed as NULL, and the name of the window, which is the string that will be shown on the title bar. Step 3 − For this, we need to add another class and derive it from the MFC's CFrameWnd class and implement its constructor and a call the Create() method, which will create a frame/window as shown in the following code.Ĭreate(NULL, _T("MFC Application Tutorial")) Step 2 − We also need a frame/window to show the content of our application. Step 1 − To create an application, we need to derive a class from the MFC's CWinApp. Let us create a window using the following steps − Step 15 − Set the Name as Example and click Add. Step 14 − In the Templates section, click C++ File (.cpp). Step 13 − Right-click on your Project and select Add → New Item. Step 11 − Select the Use MFC in Shared DLL option in Project Defaults section and click OK. Step 10 − In the left section, click Configuration Properties → General. Step 9 − To make it an MFC project, right-click on the project and select Properties. Step 7 − Select the options as shown in the dialog box given above and click Finish. Step 5 − Enter the project name ‘MFCWindowDemo’ in the Name field and click OK to continue. Step 4 − In the middle pane, select Win32 Project. Step 3 − From the left pane, select Templates → Visual C++ → Win32. Step 2 − You can now see the New Project dialog box. Step 1 − Open the Visual studio and click on the File → New → Project menu option. Let us look into a simple example by creating a new Win32 project. CWinApp stands for Class for a Windows Application. To create a program, also called an application, you derive a class from the MFC's CWinApp. In this chapter, we will be covering the fundamentals of Windows.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |