2012年11月7日 星期三

New a Dialog with CEdit and initial string problem

I want to DoModal() a new dialog with a CEdit, and there is one initial string inside the CEdit.  It's not easy to put  the string in the CEdit and show it when DoModal().  Anyway, the web link (http://stackoverflow.com/questions/11715888/domodal-does-not-show-dialog-but-does-its-work ) show us how to do it.

2012年11月5日 星期一

HTML can't use WMI(Windows Management Instrumentation)?

It's a Microsoft Windows technology for application easy to get the system information and communicate with the kernel driver.  For some information about WMI, please check http://msdn.microsoft.com/en-us/library/windows/desktop/aa394582(v=vs.85).aspx


Purpose

Windows Management Instrumentation (WMI) is the infrastructure for management data and operations on Windows-based operating systems. You can write WMI scripts or applications to automate administrative tasks on remote computers but WMI also supplies management data to other parts of the operating system and products, for example System Center Operations Manager, formerly Microsoft Operations Manager (MOM), or Windows Remote Management (WinRM).


You can check http://msdn.microsoft.com/en-us/library/windows/desktop/aa384642(v=vs.85).aspx to know "About WMI".  We can use VBscript to get the WMI information.  But anyway, we can't use HTML to get the WMI information, and it seems only ASP can use WMI.

If we can use the HTML with VBScript page to read WMI information, it will be very powerful.  But maybe it will also get some security concern.

2012年11月3日 星期六

Putting Controls On Toolbars

You can learn how to add combo box into toolbar by  http://msdn.microsoft.com/en-us/library/bb983718.aspx in the MFC project.

There is also the information in the http://msdn.microsoft.com/en-us/library/bb982770.aspx (
CMFCToolBarComboBoxButton Class).  It also show some code in the Visual Studio Demo sample of the MFC sample codes.  You can build the code and play it.

To add a combo box button to a toolbar, follow these steps:
1. Reserve a dummy resource ID for the button in the parent toolbar resource.
2. Construct a CMFCToolBarComboBoxButton object.
3. In the message handler that processes the AFX_WM_RESETTOOLBAR message, replace the dummy button with the new combo box button by usingCMFCToolBar::ReplaceButton.

But anyway, it can't work.  It take me several days to check this problem.  After all, I find we can add m_wndToolBar.ResetAll (); in the SHOWMESSAGE or SIZE message to solve this problem.