3.Right click on Project in Project Explorer->Setting -> Chosing"MFC static dll:
4.File ->New -> C++ file type into WinMain
5.Double click on WinMain.cpp and write these code:
#include
class CWindow:public CFrameWnd()
{
public:
CWindow(); //Constructor
};
CWindow::CWindow()
{
Create(NULL,_T("Windows Application")); //Create a simple window
}
class CWindowApp:CWinApp
{
public:
BOOL InitInstance();
}theApp;
BOOL CWindowApp:CWinApp
{
this->m_pMainWnd=new CWindow();
//Attach window to your application
this->m_pMainWnd->ShowWindow(SW_SHOW); //Display windows
this->m_pMainWnd->UpdateWindow();
return TRUE;
}
then press F5.
If there is any error:
1st: Check the setting of Project
2nd:Check the code above it must be exactly as what i typed.
computerwizard0
2009-06-28 08:42:23 UTC
You may consider downloading and installing LCC-Win32, a free compiler and IDE created by the University of Virginia (http://www.cs.virginia.edu/~lcc-win32/). This program includes the ability to create a project from a template. One of those templates includes a "Regular windows window." You could pull that apart if you're the kind of person that likes to learn by example. Otherwise, just use a tutorial like the one already mentioned.
Katy P
2009-06-28 08:40:52 UTC
Try looking up the WinAPI if you're really gung-ho about using C++ and having a normal (non command line) window. If you just need some simple applications though, I recommend something like Java or Visual Basic. You can get free compilers, including ones with simple GUI builders.
AJ
2009-06-28 15:15:25 UTC
This video will get you there. There are a few more to get you started in windows programming. These are very clear and easy to follow.
http://xoax.net/comp/cpp/win32/index.php
Paul
2009-06-28 08:57:39 UTC
It depends on what operating system, GUI and application framework you are using. If you give more information then you will get more appropriate and specific answers.
anonymous
2009-06-28 08:37:56 UTC
www.cplusplus.com/doc/tutorial/
this site taught me all about C++
ⓘ
This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.