This is in the main "example dlg.cpp" file:
void CHelixV3Dlg::OnBnClickedCancel()
{
CEdit* editbox = (CEdit*)GetDlgItem(IDC_EDIT1);
//works fine, defined as: *CWnd GetDlgItem(int nID); in this file
}
This is test.cpp source file
void test()
{
CEdit* editbox = (CEdit*)GetDlgItem(IDC_EDIT1);
//does not work at all, seems to be a winAPI function instead of MFC...
//defined as: HWND __stdcall GetDlgItem(HWND hDlg, int nIDDlgItem);
}
both source files are in the same project, use the same headers, but test()'s GetDlgItem is obviously a Win32 API function, which does not work in MFC... How could I get GetDlgItem() working in the test.cpp file?