napsal jsem priklad ktery je v knize programovani c++(ta kniha se jmenuje: programujeme v microsoft visual c++)
(microsoft visual c++ 6.0)
a napsal jsem tam jeden program:
myapp.h:
class CMyApp : public CWinApp
{
public:
virtual BOOL InitInstance();
} ;
class CMyFrame : public CFrameWnd
{
public:
CMyFrame();
protected:
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
} ;
a soubor: MyApp.cpp
#include <afxwin.h>
#include "myapp.h"
BOOL CMyApp::InitInstance()
{
m_pMainWnd = new CMyFrame();
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
BEGIN_MESSAGE_MAP(CMyFrame, CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_PAINT()
END_MESSAGE_MAP()
CMyFrame::CMyFrame()
{
Create(NULL, "Moje Aplikace");
}
void CMyFrame::OnPaint()
{
CPaintDC dc(this);
dc.TextOut(0, 0, "Ahoj světe");
}
a vystup linkeru byl:
--------------------Configuration: ggg - Win32 Debug--------------------
Linking...
LINK : fatal error LNK1104: cannot open file "nafxcwd.lib"
Error executing link.exe.
ggg.exe - 1 error(s), 0 warning(s)