hi,guys....need solution for this program.i had run it for few times.
no error and no warning......but u compiler it........it shows u the a big screen...........its' written there....something like the program crashes.here is the code i post it in here. )
the output of the program should..........i can draw in the window there with my mouse. before u run the program...u have to create a resource type called cursor and save it before u add it in
there.
hope someone can solve it for me.Thanks
#include<afxwin.h>
#include"resource.h"
HCURSOR hCursor;
class MyWindowublic CFrameWnd
{
public:
void OnLButtonDown(UINT flags,CPoint Point1);
void OnLButtonUp(UINT flags,CPoint Point1);
DECLARE_MESSAGE_MAP()
};
BEGIN_MESSAGE_MAP(MyWindow,CFrameWnd)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
END_MESSAGE_MAP()
void MyWindow::OnLButtonDown(UINT flags,CPoint Point1)
{
SetCapture();
::SetCursor(hCursor);
ShowCursor(TRUE);
};
void MyWindow::OnLButtonUp(UINT flags,CPoint Point1)
{
ReleaseCapture();
};
class MyAppublic CWinApp
{
public:
BOOL InitInstance();
BOOL ExitInstance();
};
BOOL MyApp::InitInstance()
{
::MessageBox(0,"Sample Window","InitInstance",MB_OK|MB_ICONASTERISK);
MyWindow *MyWindowObject;
MyWindowObject=new MyWindow;
m_pMainWnd=MyWindowObject;
MyWindowObject->ShowWindow(SW_SHOWMAXIMIZED);
hCursor=LoadCursor(MAKEINTRESOURCE(IDC_CURSOR1));
return TRUE;
}
BOOL MyApp::ExitInstance()
{
::MessageBox(0,"Sample Window","ExitInstance",MB_OK|MB_ICONHAND);
return TRUE;
}
MyApp ApplicationObject;