·天新网首页·加入收藏·设为首页
首页|笔记本|手机|数码相机|摄像机|MP3/MP4|主板|内存|显示器|办公|打印机|下载|开发|汽车|学院|业界
硬件|台式机|数码|数字家庭|投影仪|GPS/CPU|显卡|硬盘|服务器|网络|一体机|驱动|源码|游戏|考试|报价
您现在的位置:天新网 > 软件开发 > 开发语言 > VC开发
实用!超强VC/MFC 常见问答收集
http://dev.21tx.com 2004年07月15日 CSDN jiangsheng收集

上一页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 下一页



{
  ESErrPrintProviderError(g_connection);
  ESErrPrintComError(e);
  return e.Error();
 }
 return S_OK;
}
STDMETHODIMP CEnumDataType::Clone(IEnumString** ppenum)
{
 if (!ppenum)
  return E_POINTER;
 
 CEnumDataType* pnew = new CEnumDataType(m_strDataType);
 pnew->AddRef();
 *ppenum = pnew;
 return S_OK;
}

 

  问:如何在MDI环境下枚举所有打开的窗口?
  答:
In MFC, each CMDIChildWnd created by the Framework is managed as a child window of the MDIClient window. This MDIClient window is a child of the mainframe window and fills its client area. For MDI applications, the mainframe window is encapsulated by the CMDIFrameWnd class. This class has a public embedded HWND member (m_hWndMDIClient), which is the handle to the MDIClient window. For MDI applications, AppWizard derives the CMainFrame class from CMDIFrameWnd.

The MDIClient maintains an internal list of child Windows. In an MFC application, these child Windows are either a CMDIChildWnd object or an internal window used to display the title of an iconized window. Note that this is an internal list controlled by Windows; don't make assumptions about the ordering of children in the list after an API function is called.


//**mainfrm.h****************
class CMainFrame : public CMDIFrameWnd
{
...
public:
   CWnd  m_wndMDIClient;
   CWnd* m_pWndCurrentChild;
   CMDIChildWnd* GetNextMDIChildWnd();
   int GetCountCMDIChildWnds();
...
}

//**mainfrm.cpp**************
CMainFrame::CMainFrame():m_pWndCurrentChild(NULL)
{
  //.................
}

CMainFrame::~CMainFrame()

 







上一篇: 使用SkinMagic Toolkit美化界面
下一篇: 明明白白看MFC之程序框架(二)

上一页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 下一页

Google
 
热点文章
关于我们 | 联系我们 | 广告服务 | 工作机会 | 版权声明 | 欢迎投稿 | 网站地图
Copyright © 2000-2008 , www.21tx.com , All Rights Reserved .
晨新科技 版权所有 Created by TXSite.net