What is happening here is that you're trying to call the
FindWindow
and
SetDlgItemInt
APIs.
But these functions also exist as methods of the
CWnd
class.
Your
CMyView
class indirectly inherits from
CWnd
and so it is trying to invoke the
CWnd
member functions rather than the APIs.
Both versions have slightly different set of parameters.
There are 2 things that you could do to solve this issue.
You could either change the parameters to use the
CWnd
version.
Or simply scope the functions so that it uses the global scope (APIs come under global scope).
So you're code should look like this -
CMyView::OnLButtonDown(UINT nFlags, CPoint point)
{
dialg.DoModal();
HWND hdlg = ::FindWindow(NULL,_T("Dialog"));
::SetDlgItemInt(hdlg, IDC_EDIT2, 100, true);
if(IDOK)
{
}
}