|  | @@ -81,6 +81,8 @@ CIOCPModel g_iocp;
 | 
	
		
			
				|  |  |  HANDLE g_hMutex = NULL;	// 全局互斥量;
 | 
	
		
			
				|  |  |  ULONG_PTR CSATHelperApp::m_gdiplusToken = 0;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +// CMainFrame* g_pMainFrame = NULL;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  BOOL CSATHelperApp::InitInstance()
 | 
	
		
			
				|  |  |  {
 | 
	
		
			
				|  |  |  	// 如果一个运行在 Windows XP 上的应用程序清单指定要
 | 
	
	
		
			
				|  | @@ -190,7 +192,12 @@ BOOL CSATHelperApp::InitInstance()
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	// 创建主 MDI 框架窗口
 | 
	
		
			
				|  |  |  	CMainFrame* pMainFrame = new CMainFrame;
 | 
	
		
			
				|  |  | -	if (!pMainFrame || !pMainFrame->LoadFrame(IDR_MAINFRAME))
 | 
	
		
			
				|  |  | +	if ( !pMainFrame )
 | 
	
		
			
				|  |  | +		return FALSE;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +	// 创建模板类的文档对象;
 | 
	
		
			
				|  |  | +	pMainFrame->m_pDoc = (CSATHelperDoc*)pDocTemplate->CreateNewDocument();
 | 
	
		
			
				|  |  | +	if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
 | 
	
		
			
				|  |  |  	{
 | 
	
		
			
				|  |  |  		delete pMainFrame;
 | 
	
		
			
				|  |  |  		return FALSE;
 | 
	
	
		
			
				|  | @@ -204,9 +211,7 @@ BOOL CSATHelperApp::InitInstance()
 | 
	
		
			
				|  |  |  	cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
 | 
	
		
			
				|  |  |  #endif
 | 
	
		
			
				|  |  |  	ParseCommandLine(cmdInfo);
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | +	
 | 
	
		
			
				|  |  |  	// 调度在命令行中指定的命令。  如果
 | 
	
		
			
				|  |  |  	// 用 /RegServer、/Register、/Unregserver 或 /Unregister 启动应用程序,则返回 FALSE。
 | 
	
		
			
				|  |  |  	if (!ProcessShellCommand(cmdInfo))
 | 
	
	
		
			
				|  | @@ -215,22 +220,6 @@ BOOL CSATHelperApp::InitInstance()
 | 
	
		
			
				|  |  |  	pMainFrame->ShowWindow(m_nCmdShow);
 | 
	
		
			
				|  |  |  	pMainFrame->UpdateWindow();
 | 
	
		
			
				|  |  |  	
 | 
	
		
			
				|  |  | -#if 1
 | 
	
		
			
				|  |  | -	CCreateContext context;
 | 
	
		
			
				|  |  | -	CChildFrame* pChildFrame = new CChildFrame();	
 | 
	
		
			
				|  |  | -	context.m_pCurrentDoc = pDocTemplate->CreateNewDocument();
 | 
	
		
			
				|  |  | -	context.m_pNewDocTemplate = pDocTemplate;
 | 
	
		
			
				|  |  | -	context.m_pLastView = NULL;
 | 
	
		
			
				|  |  | -	context.m_pNewViewClass = RUNTIME_CLASS(CSATHelperView);
 | 
	
		
			
				|  |  | -	//pDocTemplate->CreateNewFrame(context.m_pCurrentDoc, NULL);
 | 
	
		
			
				|  |  | -	if (pChildFrame->LoadFrame(100, WS_MAXIMIZE | WS_CHILDWINDOW, pMainFrame, &context))
 | 
	
		
			
				|  |  | -	{
 | 
	
		
			
				|  |  | -		pChildFrame->ShowWindow(SW_SHOWMAXIMIZED);
 | 
	
		
			
				|  |  | -		pChildFrame->InitialUpdateFrame(context.m_pCurrentDoc, TRUE);
 | 
	
		
			
				|  |  | -		pChildFrame->MDIActivate();
 | 
	
		
			
				|  |  | -	}
 | 
	
		
			
				|  |  | -#endif
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  |  	return TRUE;
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  
 |