Hi I am trying to put up simple app, and i get an error, could you tell me what I am doing wrong please. Here is my code:
#include <afxwin.h>
class myapi: public CWinApp
{
public:
virtual BOOL InitInstance();
};
class myframe: public CFrameWnd
{
public:
myframe();
protected:
afx_msg void OnPaint();
DECLARE_MESSAGE_MAP()
};
#include "example.h"
BOOL myapi::InitInstance()
{
m_pMainWnd=new myframe;
m_pMainWnd->ShowWindow(m_nCmdShow);
m_pMainWnd->UpdateWindow();
return TRUE;
}
BEGIN_MESSAGE_MAP(myframe,CFrameWnd)
ON_WM_PAINT()
END_MESSAGE_MAP()
myframe::myframe()
{
Create(NULL,_T("bandymas I"));
}
void myframe::OnPaint()
{
//CPaintDC dc(this);
}
the error msg I get is : Unhandled exception at 0x566d2bea in gdiexample.exe: 0xC0000005: Access violation reading location 0x00000000.
thank you