Esempio n. 1
0
BOOL CText_ConverterApp::InitInstance()
{
	AfxEnableControlContainer();

	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif
	
	SetDialogBkColor(RGB(193,194,204), RGB(10,10,242));

	CText_ConverterDlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}
Esempio n. 2
0
BOOL CRaytraceApp::InitInstance()
{
	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

	SetDialogBkColor();        // Set dialog background color to gray
	LoadStdProfileSettings();  // Load standard INI file options (including MRU)

	// Register the application's document templates.  Document templates
	//  serve as the connection between documents, frame windows and views.

	CSingleDocTemplate* pDocTemplate;
	pDocTemplate = new CSingleDocTemplate(
		IDR_MAINFRAME,
		RUNTIME_CLASS(CRaytraceDoc),
		RUNTIME_CLASS(CMainFrame),     // main SDI frame window
		RUNTIME_CLASS(CRaytraceView));
	AddDocTemplate(pDocTemplate);

	// create a new (empty) document
	OnFileNew();

	if (m_lpCmdLine[0] != '\0')
	{
		// TODO: add command line processing here
	}


	return TRUE;
}
Esempio n. 3
0
BOOL CMyApp::InitInstance()
{
	SetDialogBkColor(RGB(239,242,242),RGB(50,20,20));	//设置对话框背景和字体颜色

	CMyDlg dlg;
	m_pMainWnd = &dlg;
	dlg.DoModal();

	return FALSE;
}
Esempio n. 4
0
BOOL CVideoIntecomSrvApp::InitInstance()
{
    m_Mutex = new CMutex(FALSE,"VedioIntercomSrv030407",NULL);
    if(m_Mutex->Lock(1) == 0)
    {
        AfxMessageBox("已经有另外一个实例在运行");
        return FALSE;
    }
    if (!AfxSocketInit())
    {
        AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
        return FALSE;
    }

    AfxEnableControlContainer();

    // Standard initialization
    // If you are not using these features and wish to reduce the size
    //  of your final executable, you should remove from the following
    //  the specific initialization routines you do not need.

#ifdef _AFXDLL
    Enable3dControls();			// Call this when using MFC in a shared DLL
#else
    Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif
    NET_DVR_Init();
    SetDialogBkColor(RGB(233,233,233),RGB(0,0,0));
    CVideoIntecomSrvDlg dlg;
    m_pMainWnd = &dlg;
    int nResponse = dlg.DoModal();
    if (nResponse == IDOK)
    {
        // TODO: Place code here to handle when the dialog is
        //  dismissed with OK
    }
    else if (nResponse == IDCANCEL)
    {
        // TODO: Place code here to handle when the dialog is
        //  dismissed with Cancel
    }

    // Since the dialog has been closed, return FALSE so that we exit the
    //  application, rather than start the application's message pump.
    return FALSE;
}
Esempio n. 5
0
BOOL CMapMgrApp::InitInstance()
{
	if( !FirstInstance() )
		return FALSE;

	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.


#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif


	SetDialogBkColor();        // Set dialog background color to gray
	LoadStdProfileSettings();  // Load standard INI file options (including MRU)
	AfxEnableControlContainer();

	// Register the application's document templates.  Document templates
	//  serve as the connection between documents, frame windows and views.

	CSingleDocTemplate* pDocTemplate;
	pDocTemplate = new CSingleDocTemplate(
		IDR_MAINFRAME,
		RUNTIME_CLASS(CMapMgrDoc),
		RUNTIME_CLASS(CMainFrame),     // main SDI frame window
		RUNTIME_CLASS(CPictView));
	AddDocTemplate(pDocTemplate);

	// create a new (empty) document
	OnFileNew();
    ((CMainFrame*)GetMainWnd())->RestorePosition( SW_SHOWNORMAL );

	if (m_lpCmdLine[0] != '\0')
	{
		// TODO: add command line processing here
	}

	m_pMainWnd->SendMessage( WM_COMMAND, ID_APPSTART, 0 );
	return TRUE;
}
Esempio n. 6
0
BOOL CMsregDllApp::InitInstance() 
{
	if (!CWinApp::InitInstance())
	{
		return FALSE;
	}

	CBitmapControl::RegisterMyClass();
	CWindowsMetaFileControl::RegisterMyClass();
	CProgressBar::RegisterMyClass();
	
/*
// Set default dialog background to be gray.
*/

	SetDialogBkColor();
	
/*
// Compute the working directory.
*/

	if (!SetupWorkingDirectory())
	{
		return FALSE;
	}

	CBitmapControl::SetWorkingDirectory(m_csWorkingDirectory);

	// Allocate the object used for computing international information.
	TRY
	{
		m_pInternationalInformationDll = new CInternationalInformationDll(m_csWorkingDirectory);
	}
	END_TRY

	if (m_pInternationalInformationDll == NULL)
	{
		AfxMessageBox(IDS_CantLoadInternationalInformationDll);
		return FALSE;
	}

	return TRUE;
}
Esempio n. 7
0
BOOL CMyApp::InitInstance()
{
	// Standard initialization
	
	SetDialogBkColor (RGB (250,250,250), RGB ( 0,0,0));

	CMyDlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
	}
	else if (nResponse == IDCANCEL)
	{
	}

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}
Esempio n. 8
0
/////////////////////////////////////////////////////////////////////////////
// Library init
/////////////////////////////////////////////////////////////////////////////
BOOL	CVFECIF::InitInstance()
{
	/////////////////////////////////////////////////////////////////////////
	TRACE ("VFECIF.DLL initializing\n");

	/////////////////////////////////////////////////////////////////////////
	// Initialize support DLL's
	/////////////////////////////////////////////////////////////////////////
	AmpDLLIni (0, 0L, 0L);
	FIODLLIni (0, 0L, 0L);
	MCIDLLIni (0, 0L, 0L);
	PCMDLLIni (0, 0L, (DWORD) (LPVOID) "t2c09p03");
	TMIDLLIni (0, 0L, 0L);

	/////////////////////////////////////////////////////////////////////////
	CIFGlo.hLibIns = AfxGetInstanceHandle();
	SetDialogBkColor();					// grey dialogs in the DLL as well
    MsgDspPrc = CIFDspPrc;				// Re-assignable msg output

	/////////////////////////////////////////////////////////////////////////
	return TRUE;
}
Esempio n. 9
0
BOOL CTheApp::InitInstance()
{
	Enable3dControls();
	SetDialogBkColor();
	LoadStdProfileSettings();

	// start RSI
	if (rsiInit())
		return FALSE;
	
	//rsiGetUser(&user);

	AddDocTemplate
	(
		new CMultiDocTemplate(IDR_TEXTTYPE,
		RUNTIME_CLASS(CPadDoc),
		RUNTIME_CLASS(CMDIChildWnd),
		RUNTIME_CLASS(CPadView))
	);
	m_pMainWnd = new CMainFrame;
	((CFrameWnd*)m_pMainWnd)->LoadFrame(IDR_MAINFRAME);
	m_pMainWnd->ShowWindow(m_nCmdShow);

	// enable file manager drag/drop and DDE Execute open
	m_pMainWnd->DragAcceptFiles();
	EnableShellOpen();
	RegisterShellFileTypes();

#ifndef _MAC
	// open file specified on command line
	if (m_lpCmdLine[0])
		OpenDocumentFile(m_lpCmdLine);
#endif
		
	return TRUE;
}
Esempio n. 10
0
/*************
 * DESCRIPTION:	do initializations for an instance
 * INPUT:			-
 * OUTPUT:			-
 *************/
BOOL CTheApp::InitInstance()
{
    KEYGETINFO keyGetInfo;
    HMODULE hKeyFile;
    OSVERSIONINFO OSVersionInfo;
    char szBuf[15];

    OSVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);

    if (!GetVersionEx(&OSVersionInfo))
        return FALSE;

    if (OSVersionInfo.dwMajorVersion < 4)
    {
        AfxMessageBox(IDS_ERR_PLATFORM);
        return FALSE;
    }

    // This is just for setting the current working directory in rsi.dll
    rsiInit();

    // Standard initialization
    // 3d controls and grey background
    Enable3dControls();
    SetDialogBkColor();

    // Drag and drop support
    AfxOleInit();

    strcpy(szBuf, "ke");

    // Load standard INI file options (including MRU)
    LoadStdProfileSettings();

    getcwd(szWorkingDirectory, 256);


    // get user name and serial number out of keyfile
    strcpy(szUserName, "");
    strcat(szBuf, "yfil");

    nUserSernum = 0;

    strcat(szBuf, "e.dll");

    hKeyFile = LoadLibrary(szBuf);
    if (hKeyFile)
    {
        keyGetInfo = (KEYGETINFO)GetProcAddress(hKeyFile, (LPCSTR)2);
        keyGetInfo(szUserName, &nUserSernum);
        FreeLibrary(hKeyFile);
    }

    // Register document templates
    CSingleDocTemplate *pDocTemplate;
    pDocTemplate = new CSingleDocTemplate(IDR_MAINFRAME,
                                          RUNTIME_CLASS(CDoc),
                                          RUNTIME_CLASS(CMainFrame),       // main SDI frame window
                                          RUNTIME_CLASS(CCamView));

    AddDocTemplate(pDocTemplate);

    OnFileNew();

    return TRUE;
}