Category : mfc

MDI or SDI App. How can we right immediately update an Indicator in Statusbar before call a MessageBox? The MessageBox, stops, inhibit CWinApp::OnIdle() which is need for the handler ON_UPDATE_COMMAND_UI(ID_INDICATOR_STATUS_MACHINE, &CMainFrame::OnUpdateIndicatorStatusMachine). This SendMessage just before is too late too AfxGetMainWnd()->PostMessage(WM_COMMAND, WM_IDLEUPDATECMDUI); Source: Windows Que..

Read more

I have a simple MFC Dialog-based Application. I subclass CListCtrl and handle messages in my own class. In that class, I call SetTimer(0,15000,NULL) to display message box for testing purpose . The problem is, it displays only one time and not getting called later. In main dialog DDX_Control(pDX, IDC_LIST1, m_listView); In CListCtrl subclassed SetTimer(0,15000,NULL); In ..

Read more

I’m writing a program which logs out to the file with file-mapping. When I want to read the log, Logger::Destroy() is called so that the content writed on file-mapped-view could be flushed to the physical file. The code is as follows: int Logger::Destroy() { if (m_lpMapAddress) { auto bRet = UnmapViewOfFile(m_lpMapAddress); // succeed } if ..

Read more