vc++编程问题

来源:百度知道 编辑:UC知道 时间:2024/05/14 07:04:45
AfxGetMainWnd()是什么?
能能给出具体的几个应用例子吗?
摆脱各位大虾?
GetActiveView()又是什么?
能能给出具体的几个应用例子吗?
摆脱各位大虾?

AfxGetMainWnd()这个函数是用来获得主窗口的。在MFC中经常要修改主窗口的属性,所以特别提供了这个函数。还有一些Afx开头的函数,也都非常有用。
MSDN中说明:
AfxGetMainWnd
CWnd* AfxGetMainWnd( );

Return Value

If the server has an object that is in-place active inside a container, and this container is active, this function returns a pointer to the frame window object that contains the in-place active document.

If there is no object that is in-place active within a container, or your application is not an OLE server, this function simply returns the m_pMainWnd of your application object.

If AfxGetMainWnd is called from the application's primary thread, it returns the application's main window according to the above rules. If the function is called from a secondary thread in the application, the function returns the main window associated with the thread that made the call.

Remarks

If your application is an OLE server, call this function to retrieve a pointer to