Category : mfc

I am refactoring a big legacy project. It used to link libraries within its source files via #pragma comment(lib, "lib_name.lib"). Once I’ve moved #pragma comment(lib, "mmc.lib") from the .cpp file to .vcxproj, I started receiving multiple definitions linker error: 1>uafxcwd.lib(afxstate.obj) : error LNK2005: "public: __cdecl AFX_MAINTAIN_STATE2::~AFX_MAINTAIN_STATE2(void)" ([email protected]@[email protected]) already defined in mmc.lib(apimfc.obj) I couldn’t find the ..

Read more

I created a Groupbox in my MFC view class. But failed in refresh it while Restore Down from Maxmize as well as Maxmize from Restore Down. I create the Groupbox in View::OnCreate: int Cmfc_gui_test3View::OnCreate(LPCREATESTRUCT lpCreateStruct) { … CRect mybox( 0, 0,350, 1000); pmyGroupBox->Create(_T("Test GroupBox"), WS_CHILD | WS_VISIBLE | BS_CENTER | BS_GROUPBOX|WS_BORDER, mybox, this, IDG_GROUPBOX1); … ..

Read more

MSAA (Microsoft Active Accessibility) allows dynamic annotation wherein certain accessibility properties of controls can be set without having to re-implement MSAA interfaces. Specifically server annotation (which is a type of dynamic annotation) can be used to set properties of a control whose IAccessible interface we have. How can similar thing be achieved using UI Automation? ..

Read more

I have been trying the methods all over the internet. It’s showing the same error over and over. This is the initial cpp and headers when start a MCF application with default configurations. I think those stuff didn’t even need math.h as I couldn’t find #include<math.h> anywhere in the headers and cpp files, I checked ..

Read more

I have sublassed CEdit control (CCheckeEdit). I need to catch ON_CHANGE for this class and send the message to dialog (catch EN_CHANGE in dialog too) In sublassed CCheckeEdit I have followed hook procedure: void CCheckedEdit::OnEnChange() { Validing(); int res = ::SendMessage(GetParent()->m_hWnd, WM_COMMAND, (WPARAM)MAKELONG(3, EN_CHANGE), (LPARAM)GetParent()->m_hWnd); } and in dialog I have: BEGIN_MESSAGE_MAP(CProjMfcDlg, CMjAcDialog) ON_EN_CHANGE(IDC_EDIT, &CProjMfcDlg::OnEnChangeEdit) ..

Read more