Esempio n. 1
0
void CEScriptDocument::NewWindow(IEFrame* eframe)
{
#if 0
	CComQIPtr<ILXAddin> addin = m_app;
	CComPtr<ILXAddinSite> addinSite;
	addin->GetSite(&addinSite);

	CComPtr<IUIManager> uiManager;
	addinSite->GetUIManager((IUnknown**)&uiManager);

//	CComQIPtr<IUIManager> uiManager = gApp->m_frame;

	CComQIPtr<IUIMDIFrame> mdiframe = eframe;

	CComObject<CScriptSourceView>* textView;
	CComObject<CScriptSourceView>::CreateInstance(&textView);
	if (textView)
	{
		ATLASSERT(0);
#if 0
		uiManager->FindMenu(_Module.GetResourceInstance(), IDR_TEXTVIEW, &textView->m_menu);

		textView->m_document = this;

		CComPtr<IUIMDIChild> childFrame;
		mdiframe->CreateChildFrame(textView, &childFrame);
#endif
	}

#if 0
//	CComQIPtr<IUIManager> uiManager = gApp->m_uiManager;

	{
		CComObject<CUIMDIChild>* child;
		CComObject<CUIMDIChild>::CreateInstance(&child);
		child->AddRef();

	//	CComQIPtr<IEDocument> webdoc;
	//	QueryInterface(IID_IEDocument, (void**)&webdoc);

		{
		// Source
			CComObject<CSourceView>* sourceView;
			CComObject<CSourceView>::CreateInstance(&sourceView);
			sourceView->m_document = this;
			child->AddPage(sourceView, NULL);
		}

		child->CreateEx(gApp->m_frame, gApp->m_frame->m_hWndClient);
	}
#endif
#endif
}
Esempio n. 2
0
int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
	int nRet = 0;
	{
		CAppSingleInstance m_appSingleInstance;
		if(m_appSingleInstance.IsAnotherInstanceRunning())
		{
			CString msgAlreadyRunning;
			msgAlreadyRunning.LoadString(IDS_ALREADYRUNNING);
			CString strCaption;
			strCaption.LoadString(IDS_CAPTION);
			MessageBox(NULL, msgAlreadyRunning, strCaption, 0);
			return 1;
		}

		CMessageLoop theLoop;
		_Module.AddMessageLoop(&theLoop);

		SetCurrentDirectoryToApplicationRoot();
		g_hObjMdl = LoadLibrary(L"objmdl.dll");
		GetPluginManager()->InitializePluginLibraryByHandle(g_hObjMdl);
		GetPluginManager()->InitializePluginLibraryByName(L"viewmdl.dll");
		GetPluginManager()->InitializePluginLibraryByName(L"asyncsvc.dll");
		GetPluginManager()->LoadPlugins(NULL);

		CComObject<CMainDlg>* pMainDlg;
		CComObject<CMainDlg>::CreateInstance(&pMainDlg);
		HWND hWnd = 0;

		if (FAILED(pMainDlg->CreateEx(NULL, &hWnd)))
		{
			ATLTRACE(_T("Main dialog creation failed!\n"));
			return 0;
		}

		::ShowWindow(hWnd, SW_HIDE);

		nRet = theLoop.Run();

		_Module.RemoveMessageLoop();
	}

#ifdef _DEBUG
	_CrtDumpMemoryLeaks();
#endif

	return nRet;
}