⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stdafx.cpp

📁 客户端服务器源码
💻 CPP
字号:
// stdafx.cpp : source file that includes just the standard includes
//	clientMain.pch will be the pre-compiled header
//	stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"
#include <string>


CFrameWnd* EkCreateNewWindow( CDocTemplate* pTemplate,
                              CDocument* pDocument )
{
	ASSERT_VALID( pTemplate );
	ASSERT_VALID( pDocument );

	// 1 - Create the new frame window
	// (will in turn create the associated view)
	CFrameWnd* pFrame = pTemplate->CreateNewFrame(
										pDocument, NULL );

	if( pFrame == NULL )
	{
		// Window creation failed
		TRACE0( "Warning: failed to create new frame.\n" );
		return NULL;
	}
	ASSERT_KINDOF( CFrameWnd, pFrame );

	// 2 - Tell the frame to update itself
	// (and its child windows)
	pTemplate->InitialUpdateFrame( pFrame, pDocument );

	// 3 - Return a pointer to the new frame window object
	return pFrame;
}

CDocument* EkGetActiveDocument()
{
	// 1 - Get a pointer to the application's
	// main frame window
	CWnd* pWnd = AfxGetMainWnd();
	if( pWnd == NULL )
		return NULL;

	// 2 - Make sure the pointer is valid and more
	// strongly typed
	ASSERT_VALID( pWnd );
	ASSERT_KINDOF( CFrameWnd, pWnd );
	CFrameWnd* pMainFrame = static_cast< CFrameWnd* >( pWnd );

	// 3 - Get a pointer to the active frame window
	// (may be 'this' for SDI application)
	CFrameWnd* pActiveFrame = pMainFrame->GetActiveFrame();
	if( pActiveFrame == NULL )
		return NULL;

	// 4 - Return a pointer to the active document object
	return pActiveFrame->GetActiveDocument();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -