摘要:通过结构体传递参数给线程。目的:在一个对话框中,点击按钮启动多个线程调用外部的程序(批处理) ,获取返回值后,将结果依次更新到多个Edit控件思路 : 通过包含控件信息的一个结构体传递参数给线程,在线程函数中控制控件的数据更新。步骤 : 1.在对话框类的头文件XXXDlg.h中建立一个结构体, 包括指向控件的指针。struct threadInfo{ CEdit *pEdit1_1;}接着,申明线程函数: UINT ThreadFunc(LPVOID lpParam);注意,以上二者应在类CXXXDlg的外部。2. 在XXXDlg.cpp文件中定义公共变量: (全局变量 )threadInfo
阅读全文
随笔分类 - VC/MFC
摘要:批处理 ShellExecute(null, "open ", "c:\\abc.bat ", " ", " ",SW_SHOW ); 深入浅出ShellExecute 译者:徐景周(原作:Nishant S) Q: 如何打开一个应用程序? 正如您所看到的,我并没有传递程序的完整路径。 Q: 如何打开一个同系统程序相关连的文档? ShellExecute(this-> m_hWnd, "open ","c:\\abc.txt ", " ", &quo
阅读全文
摘要:HRESULTWhat we should know about HRESULT ?- HRSULT is a kind of Data Type ( Long 32bit) which is used for Windows. - It is The return codes used by COM interfaces.- To test an HRESULT value, use the FAILED and SUCCESSED macros.- This type is declared in WinNT.h as follows: typedef LONG HRESULT; Stru
阅读全文
摘要:CListBox如下继承关系COBject : CCmdTarget : CWnd : CListBox *说明:下面英文部分摘自MSDN MFC Reference.In a single-selection list box, the user can select only one item.In a multiple-selection list box, a range of itmes can be selected.When the user selects an item, it is highliaged and the list box sends a notificati
阅读全文