我看了MSDN中的解释和它给出的示例:// Using Attach and Detach to map to the MDI client window
class CMainFrame : public CMDIFrameWnd
{
...
public:
CWnd m_wndMDIClient;
}CMainFrame::~CMainFrame()
{
// detach MDI client window
m_wndMDIClient.Detach();
}int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1; // attach MDI client window
if (m_wndMDIClient.Attach(m_hWndMDIClient) == 0)
{
TRACE0("Failed to attach MDIClient.\n");
return -1; // fail to create
}
}
可我还是不知道该怎么使用,有谁能帮忙吗?高分相送……
解决方案 »
- listen的奇怪问题
- 网管可以随便访问职工的计算机,在不知不觉的情况下复制走职工的文件、盗窃职工计算机的开机密码等,如何限制网管的这些不法行为呢?
- 超级弱的问题,近来看得人都会的问题
- 对话框
- 在线急求高手,怎么调用类的成员函数?
- 老潘的“com原理”有个CFactory::LockServer(BOOL bLock)函数没有明白其含义,也没有看到谁调用了它?
- 请问api和mfc是什么关系谢谢各位!!!!!!!!!!
- *.dts格式的文件怎样阅读
- 请教大侠们!!!
- 学MFC……迷茫!请高人指点
- 编译出错;无法找到动态链接库MSDIS100.dll于指定的路径......
- GetMenuItemInfo()函数的使用,急用。
{
...
public:
CWnd m_wndMDIClient;
}
/////////////////////////
CWnd m_wndMDIClient;
在这里的这个成员变量是干什么用的啊?
m_hWndMDIClient什么是候初始化的?http://expert.csdn.net/Expert/topic/1267/1267581.xml?temp=.644314
BOOL Attach( HWND hWndNew );Return ValueNonzero if successful; otherwise 0.ParametershWndNewSpecifies a handle to a Windows window.ResAttaches a Windows window to a CWnd object.Example// Using Attach and Detach to map to the MDI client window
class CMainFrame : public CMDIFrameWnd
{
...
public:
CWnd m_wndMDIClient;
}CMainFrame::~CMainFrame()
{
// detach MDI client window
m_wndMDIClient.Detach();
}int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1; // attach MDI client window
if (m_wndMDIClient.Attach(m_hWndMDIClient) == 0)
{
TRACE0("Failed to attach MDIClient.\n");
return -1; // fail to create
}
}甜心MM你MFC也在学吗?~~~~~~~~~~~
太可怕了
//////////////////////////////
甜心MM你MFC也在学吗?~~~~~~~~~~~
太可怕了
/////////////////////
我过两天就要去学MFC了,现在还在看《windows程序设计》。
有了这个CWnd对象很多动作实现起来方便了很多...
Fun(HWND hwnd)
{
MoveWindow(hwnd,0,0,100,100,true);
}
2.use CWndFun (HWND hwnd)
{
CWnd Wnd;
Wnd.Attach(hwnd);
Wnd.MoveWindow(0,0,100,100,true);
Wnd.Detach();
}