this code compiles fine in Debug mode but when i try to compile it in final mode i get 2 errors:
Code:
Error 1:
Line Draw error LNK2019: unresolved external symbol __endthreadex referenced in function "void __stdcall AfxEndThread(unsigned int,int)" (?AfxEndThread@@YGXIH@Z)
Error 2:
Line Draw error LNK2019: unresolved external symbol __beginthreadex referenced in function "public: int __thiscall CWinThread::CreateThread(unsigned long,unsigned int,struct _SECURITY_ATTRIBUTES *)" (?CreateThread@CWinThread@@QAEHKIPAU_SECURITY_ATTRIBUTES@@@Z)
MY CODE:
Code:
#include <afxwin.h>
class CMainWindow: public CFrameWnd
{
CPoint m_StartPoint, m_EndPoint;
public:
CMainWindow()
{
Create(NULL, "MyWnd");
}
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(CMainWindow, CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
END_MESSAGE_MAP()
void CMainWindow::OnLButtonDown(UINT nFlags, CPoint point)
{
CFrameWnd::OnLButtonDown(nFlags, point);
m_StartPoint = point;
}
void CMainWindow::OnLButtonUp(UINT nFlags, CPoint point)
{
CFrameWnd::OnLButtonUp(nFlags, point);
m_EndPoint = point;
CClientDC dc(this);
dc.MoveTo(m_StartPoint);
dc.LineTo(m_EndPoint);
}
class MyApp: public CWinApp
{
CMainWindow* Wnd;
public:
virtual BOOL InitInstance()
{
Wnd = new CMainWindow();
m_pMainWnd = Wnd;
m_pMainWnd->ShowWindow(1);
return TRUE;
}
};
MyApp MyAPP;