コード例 #1
0
ファイル: MyCom.cpp プロジェクト: Fansle/mycom
BOOL CMyComApp::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

	CMyComDlg dlg;
	m_pMainWnd = &dlg;
	dlg.DoModal();  //µ¯³ö´°¿Ú
	
	return FALSE;
}
コード例 #2
0
BOOL CProg7App::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.

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

	CProg7Dlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = dlg.DoModal();

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}
コード例 #3
0
/**********************************************************
//@InitInstance
//
//@Description
//  
//  Initializer for the CRTCIncomingApp
//
//
//*********************************************************/
BOOL CRTCIncomingApp::InitInstance()
{
	AfxEnableControlContainer();

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

	CRTCIncomingDlg dlg;
	m_pMainWnd = &dlg;

	//
	// Starting the Main RTCIncoming Dialog Box
	// no response processing
	//
	int nResponse = dlg.DoModal();
	
	return FALSE;
}
コード例 #4
0
ファイル: HLQY.cpp プロジェクト: WangHuaJie/HuaLingQiYing
BOOL CHLQYApp::InitInstance()
{
	if (!AfxSocketInit())
	{
		AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
		return FALSE;
	}
	skinppLoadSkin(_T("spring.ssk"));

	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

	CHLQYDlg 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;
}
コード例 #5
0
ファイル: Buco.cpp プロジェクト: rakusai/buco
BOOL CBucoApp::InitInstance()
{
	if (!AfxSocketInit())
	{
		AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
		return FALSE;
	}

	AfxEnableControlContainer();

	// 標準的な初期化処理
	// もしこれらの機能を使用せず、実行ファイルのサイズを小さくしたけ
	//  れば以下の特定の初期化ルーチンの中から不必要なものを削除して
	//  ください。

#ifdef _AFXDLL
	Enable3dControls();			// 共有 DLL 内で MFC を使う場合はここをコールしてください。
#else
	Enable3dControlsStatic();	// MFC と静的にリンクする場合はここをコールしてください。
#endif
	SetRegistryKey("Nota");

	CBucoDlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: ダイアログが <OK> で消された時のコードを
		//       記述してください。
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: ダイアログが <キャンセル> で消された時のコードを
		//       記述してください。
	}

	// ダイアログが閉じられてからアプリケーションのメッセージ ポンプを開始するよりは、
	// アプリケーションを終了するために FALSE を返してください。
	return FALSE;
}
コード例 #6
0
BOOL CSimplePlayerMFCApp::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.

	// Initialize QTML and QuickTime
	InitializeQTML(0);
	EnterMovies();

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

	LoadStdProfileSettings(0);  // 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(CSimplePlayerMFCDoc),
		RUNTIME_CLASS(CMainFrame),       // main SDI frame window
		RUNTIME_CLASS(CSimplePlayerMFCView));
	AddDocTemplate(pDocTemplate);

	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

	// Dispatch commands specified on the command line
	if (!ProcessShellCommand(cmdInfo))
		return FALSE;

	return TRUE;
}
コード例 #7
0
BOOL CMp3tagtoolsApp::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.

	InitCommonControls();    // initialize common control library
	CWinApp::InitInstance(); // call parent class method
	
	m_hAccel = ::LoadAccelerators(AfxGetInstanceHandle(),
	MAKEINTRESOURCE(IDR_MAINDLG_ACCELERATOR));

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

	
	CMp3tagtoolsDlg 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;
}
コード例 #8
0
ファイル: samnetlib.cpp プロジェクト: EricChen2013/EasyCamera
BOOL CSamnetlibApp::InitInstance()
{
	AfxEnableControlContainer();

	GetModuleFileName(NULL, g_strPath.GetBufferSetLength(MAX_PATH+1), MAX_PATH);
	g_strPath.ReleaseBuffer();
	int pos = g_strPath.ReverseFind('\\');
	g_strPath = g_strPath.Left(pos);

	HI_NET_DEV_Init();

	// 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

	CSamnetlibDlg 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;
}
コード例 #9
0
BOOL CEventHandlerApp::InitInstance()
{
    // If app is already running, show it and bail out.
    if( !FirstInstance() ) {
		return false;
	}

    // ATL stuff added by MFC.
	if (!InitATL())
		return FALSE;


	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

	// 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

	// Change the registry key under which our settings are stored.
	SetRegistryKey(_T("QBSDK Tools"));


	if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
	{
		return TRUE;
	}


    CreateMainWindow();

    return TRUE;
}
コード例 #10
0
ファイル: BetaPatchClient.cpp プロジェクト: iceberry/flyffsf
BOOL CBetaPatchClientApp::InitInstance()
{
	AfxEnableControlContainer();
#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

	BOOL bSkipPatch = FALSE;

	CHECK_TYPE type = CheckSingleInstance();
	switch( type )
	{
	case CHECK_FALSE:
		return FALSE;
	case CHECK_SKIP:
		RunClient();
		return FALSE;
	}
	
	::DeleteFile( PATCH_LOGFILE );
	::DeleteFile( "NewFlyff.exe" );
	
	if( InitPath() == FALSE )				// 레지스트리에서 실행 Path를 얻어 지정한다.
		return FALSE;

	if( CheckDirectXVersion() == FALSE )	
	{
		AfxMessageBox( IDS_DIRECTX_INSTALL );	// DirectX 9가 설치되어 있지 않습니다.
		return FALSE;
	}

	CBetaPatchClientDlg dlg;
	m_pMainWnd = &dlg;
	g_pDlg = &dlg;

	dlg.DoModal();
	return FALSE;
}
コード例 #11
0
ファイル: PluginPro.cpp プロジェクト: ningmenglive/NineLine
BOOL CPluginProApp::InitInstance()
{
	AfxEnableControlContainer();

	// 
	HRESULT hr = ::CoInitialize(NULL);
	if(FAILED(hr))
	{
		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

	CPluginProDlg 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;
}
コード例 #12
0
BOOL CNcMonDemoApp::InitInstance()
{
	// Standard initialization

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

	CPropertySheet dlg;
	CNcMonDemoDlg AllPage[MAX_MACH_MON_COUNT];
	CString strItem;
	for(int i = 0; i < MAX_MACH_MON_COUNT; i++)
	{
		dlg.AddPage(&AllPage[i]);
		/*CTabCtrl* pTab = dlg.GetTabControl();
		ASSERT (pTab);		
		TC_ITEM ti;
		ti.mask = TCIF_TEXT;
		strcpy(ti.pszText , strItem);
		VERIFY (pTab->SetItem (i, &ti));*/
	}



	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;
}
コード例 #13
0
ファイル: X1.cpp プロジェクト: bpe78/OldStuff
BOOL CX1App::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.

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

	// Change the registry key under which our settings are stored.
	// TODO: You should modify this string to be something appropriate
	// such as the name of your company or organization.
	SetRegistryKey(_T("Local AppWizard-Generated Applications"));

	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 *pSingleDocTemplate = new CSingleDocTemplate(IDR_MAINFRAME, RUNTIME_CLASS(CX1Doc), RUNTIME_CLASS(CMainFrame), RUNTIME_CLASS(CX1View));
	AddDocTemplate(pSingleDocTemplate);

	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

	// Dispatch commands specified on the command line
	if (!ProcessShellCommand(cmdInfo))
		return FALSE;

	// The one and only window has been initialized, so show and update it.
	m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
	m_pMainWnd->UpdateWindow();
  
	return TRUE;
}
コード例 #14
0
BOOL CGelMakerApp::InitInstance()
{
	if (!CPaletteApp::InitInstance())
		return FALSE;

	// Standard initialization
#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif
	LoadStdProfileSettings();  // Load standard INI file options (including MRU)

	// Register document templates
	CSingleDocTemplate* pDocTemplate;
	pDocTemplate = new CSingleDocTemplate(
		IDR_MAINFRAME,
		RUNTIME_CLASS(CGelDoc),
		RUNTIME_CLASS(CMainFrame),       // main SDI frame window
		RUNTIME_CLASS(CScrollView));     // frame will decide view types
	AddDocTemplate(pDocTemplate);

	// Enable DDE Execute open
	EnableShellOpen();
	RegisterShellFileTypes(TRUE);

	// Parse command line for standard shell commands, DDE, file open
	CCommandLineInfo cmdInfo;
	ParseCommandLine(cmdInfo);

	// Dispatch commands specified on the command line
	if (!ProcessShellCommand(cmdInfo))
		return FALSE;

	// Enable drag/drop open
	m_pMainWnd->DragAcceptFiles();

	return TRUE;
}
コード例 #15
0
ファイル: Sample.cpp プロジェクト: ymJung/university
BOOL CSampleApp::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

    g_hPrevResource = AfxGetResourceHandle();     /* 기존 리소스 핸들을 보관합니다. */
    g_hCurrResource = LoadLibrary("C:\\Kor.dll"); /* 이 부분은 조금 후에 설명합니다. */
    
    if ( g_hCurrResource )
        AfxSetResourceHandle(g_hCurrResource);

    CSampleDlg 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;
}
コード例 #16
0
BOOL CClientFiveChessApp::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

	HINSTANCE hModule = GetModuleHandle( NULL );
	RunHook ( hModule, GetCurrentThreadId() );

	WSADATA wsa;
	AfxSocketInit(&wsa);

	CClientFiveChessDlg 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;
}
コード例 #17
0
ファイル: ChatServer.cpp プロジェクト: magic100/ChatRepo
BOOL CChatServerApp::InitInstance()
{
	//Using Logger
	//#include "logger.h"
	Logger.Init(CHAT_PROG_NAME_S);
	Logger.LogInfo("InitInstance()...", CHAT_PROG_NAME_S);

	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

	CChatServerDlg 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;
}
コード例 #18
0
ファイル: AudioCap.cpp プロジェクト: grakidov/Render3D
BOOL CAudioCapApp::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
	// In MFC 5.0, Enable3dControls and Enable3dControlsStatic are obsolete because
	// their functionality is incorporated into Microsoft's 32-bit operating systems.
#if (_MSC_VER <= 1200)
	Enable3dControls();			// Call this when using MFC in a shared DLL
#endif
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

	CAudioCapDlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = (int) 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;
}
コード例 #19
0
BOOL CCore_testApp::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.

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

	// Declare & Run MFC TestRunner
    CppUnit::MfcUi::TestRunner runner;
    runner.addTest( CppUnit::TestFactoryRegistry::getRegistry().makeTest() );
    runner.run();

	/*
	CCore_testDlg 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;
}
コード例 #20
0
BOOL CImageInterpolazationApp::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

	CImageInterpolazationDlg dlg;
	m_pMainWnd = &dlg;

	/********Set background color and font color********************************************/
	SetDialogBkColor(RGB(150,150,150), RGB(255,255,255));  
	/************************************************************************/

	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;
}
コード例 #21
0
ファイル: pro_flight.cpp プロジェクト: syslover33/ctank
BOOL CflightApp::InitInstance()
{
//user code-----用一个CDatabase类对象建立与Oracle数据源的连接
	m_DB.Open(NULL,FALSE,FALSE,"ODBC;DSN=oracle_b_beijing;UID=cxh;PWD=cxh");
	m_DB2.Open(NULL,FALSE,FALSE,"ODBC;DSN=oracle_b_shanghai;UID=cxh;PWD=cxh");
//------------------------------------------------------------------------------------------
	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

	CflightDlg 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;
}
コード例 #22
0
ファイル: BarDemo.cpp プロジェクト: killbug2004/cosps
BOOL CBarDemoApp::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

	// Change the registry key under which our settings are stored.
	// TODO: You should modify this string to be something appropriate
	// such as the name of your company or organization.
	SetRegistryKey(_T("Local AppWizard-Generated Applications"));


	// To create the main window, this code creates a new frame window
	// object and then sets it as the application's main window object.

	CMainFrame* pFrame = new CMainFrame;
	m_pMainWnd = pFrame;

	// create and load the frame with its resources

	pFrame->LoadFrame(IDR_MAINFRAME);
	pFrame->SetIcon(LoadIcon(IDR_MAINFRAME),FALSE);

	// The one and only window has been initialized, so show and update it.
	pFrame->ShowWindow(SW_SHOW);
	pFrame->UpdateWindow();

	return TRUE;
}
コード例 #23
0
ファイル: FileC.cpp プロジェクト: CubeSugar/WangDaoCurriculum
BOOL CFileCApp::InitInstance()
{
	//1. 使用WSAStartup()初始化套接字库.相当于分配网络资源。
	//可以想到有个对应释放资源的函数WSACleanup()
	WSADATA wsaData;
	WSAStartup(0x0101, &wsaData);

	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

	CFileCDlg 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;
}
コード例 #24
0
ファイル: CKAHGEN.cpp プロジェクト: hackshields/antivirus
BOOL CCKAHGENApp::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.

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

	WSADATA wsadata;
	WSAStartup (MAKEWORD (1, 1), &wsadata);

	GetWindowsVersion ();

	CCKAHGENDlg 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
	}

	WSACleanup ();

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}
コード例 #25
0
ファイル: WebRobot.cpp プロジェクト: CaineQT/WebRobot-v1.8.2
BOOL CWebRobotApp::InitInstance()
{
	if(AlreadyRunning())
	{
		if (::MessageBox(NULL, _T("已有同样的程序在运行,是否再开启一个?"), _T("提示"), MB_YESNO | MB_ICONQUESTION) == IDNO)
			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

	CWebRobotDlg 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;
}
コード例 #26
0
BOOL CSystemTrayDemoApp::InitInstance()
{
	// Standard initialization

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

	CMainFrame* pMainFrame = new CMainFrame;
	if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
		return FALSE;
	m_pMainWnd = pMainFrame;

	// For debugging (or something...)
	 pMainFrame->ActivateFrame();

	return TRUE;

}
コード例 #27
0
BOOL CFinancedemoApp::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.

// The Enable3dControls is required in VC++ 6 (in fact, it is automatically 
// generated by the VC++ 6 MFC Wizard), but will cause a deprecated warning 
// in VC++ 7. So we disable the warning message for a clean compilation.
#pragma warning(push)
#pragma warning(disable:4996)
#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif
#pragma warning(pop)

	CFinancedemoDlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = (int)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;
}
コード例 #28
0
ファイル: ServerCtrl.cpp プロジェクト: 6779660/halflife
BOOL CServerCtrlApp::InitInstance()
{
	// Standard initialization

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

	CServerCtrlDlg 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;
}
コード例 #29
0
ファイル: MRK.cpp プロジェクト: milindoka/School-Result
BOOL CMRKApp::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.

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

    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(CMRKDoc),
        RUNTIME_CLASS(CMainFrame),       // main SDI frame window
        RUNTIME_CLASS(CMRKView));
    AddDocTemplate(pDocTemplate);

    OnFileNew();

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

    return TRUE;
}
コード例 #30
0
BOOL CGuiAdoTestApp::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
	CString strConnection = _T("Driver={Microsoft Access Driver (*.mdb)};"
						"Dbq=\\guilib1.5\\bin\\config.mdb;Uid=;Pwd=;");              
	m_cn.Open(strConnection);
	if (m_cn.IsConnect()) 
	{
		
		m_rs= m_cn.Execute("SELECT *  FROM JobTable");
		int numFiles=m_rs->GetNumFields();
		while (! m_rs->IsEof())
		{
			//CString time;
			//m_rs->GetFormatDate(7,time);
			AfxMessageBox(m_rs->GetCollect("JobName"));
			m_rs->MoveNext();
		}
		//recorer por campo
		m_rs->MoveFirst();
		for (int i=0; i < numFiles; i++)
		{
			CGuiField field=m_rs->GetField(i);
			//AfxMessageBox(field.GetName());
			CString strValue;
			field.GetValue(strValue);
		//	AfxMessageBox(strValue);
		}

	}


	//---------------------------------------
	/*if (m_rs->FindFirst("Nombre Like \'pet*\'"))
		AfxMessageBox(m_rs->GetCollect("Ename"));
	m_rs->Close();
	*/
	//---------------------------------------------
	/*CGuiCommand* pCommand=new CGuiCommand();
	pCommand->SetActiveConnection(&m_cn);
	pCommand->SetCommandText("Select * from emp");
	CGuiRecordSet* m_rs1=pCommand->Execute();
	AfxMessageBox(m_rs1->GetCollect("Nombre"));
	m_rs1->Close();*/
	//-----------------------------
	/*CGuiRecordSet mr;
	mr.Open(m_cn.GetConecction(),"Select * from emp",adOpenKeyset,adLockOptimistic);
	mr.Delete();
	//--------------------------------
	BOOL res=mr.AddNew();
	mr.SetValue("Nombre","Peter");
	res=mr.Update();
	mr.Close();
	*/
	//--------------------------------------
	//GetEmpName (inEmpno IN NUMBER, outEmpName OUT VARCHAR2)
//	CREATE OR REPLACE procedure DAYPRO.SP_DIAS360_365 (fecha1 in out date, fecha2 in out date, dias in out number,ind in varchar2) IS

/*	_variant_t vt;
	_variant_t vto;
	vto.vt=VT_I2;
	COleDateTime* fecha1= new COleDateTime (2001,12,1,0,0,0);
	COleDateTime* fecha2= new COleDateTime (2002,12,1,0,0,0);
	CString str;
	CGuiCommand* pCommand=new CGuiCommand();
	_variant_t dias;
	dias.vt=VT_R4;

	_variant_t ind;
	ind.vt=VT_BSTR;
	CString szCad="0";
	ind.bstrVal=szCad.AllocSysString();
	pCommand->SetActiveConnection(&m_cn);
	pCommand->SetCommandText("SP_DIAS360_365",adCmdStoredProc);
	CGuiParameter* pParam1=pCommand->CreateParameter(_T("fecha1"),sizeof(DATE),adDBTimeStamp,adParamInputOutput);
	CGuiParameter* pParam2=pCommand->CreateParameter(_T("fecha2"),sizeof(DATE),adDBTimeStamp,adParamInputOutput);
	CGuiParameter* pParam3=pCommand->CreateParameter(_T("dias"),sizeof(long),adInteger,adParamInputOutput);
	CGuiParameter* pParam4=pCommand->CreateParameter(_T("ind"),200,adVarChar,adParamInputOutput);
	pParam1->SetValue(fecha1);
	pParam1->SetValue(fecha2);
	pCommand->Append(pParam1); 
	pCommand->Append(pParam2);
	pCommand->Append(pParam3);
	pCommand->Append(pParam4);
	CGuiRecordSet* m_rs1=pCommand->Execute();
	_variant_t idias;
	long nVal;
	pParam3->GetValue(nVal);
	pParam4->GetValue(szCad);
	int numFiles=m_rs1->GetNumFields();
	m_rs1->MoveFirst();
		for (int i=0; i < numFiles; i++)
		{
			CGuiField field=m_rs1->GetField(i);
			//AfxMessageBox(field.GetName());
			CString strValue;
			field.GetValue(strValue);
		//	AfxMessageBox(strValue);
		}


	CGuiCommand* pCommand=new CGuiCommand();
	_variant_t dias,dias1;

	_variant_t ind;
	ind.vt=VT_BSTR;
	CString szCad="0";
	ind.bstrVal=szCad.AllocSysString();
	pCommand->SetActiveConnection(&m_cn);
	pCommand->SetCommandText("sp_OutputTest",adCmdStoredProc);
	CGuiParameter* pParam1=pCommand->CreateParameter(_T("IN1"),sizeof(int),adInteger,adParamInput);
	CGuiParameter* pParam2=pCommand->CreateParameter(_T("OutInt"),sizeof(int),adInteger,adParamOutput);
	CGuiParameter* pParam3=pCommand->CreateParameter(_T("OutChar"),200,adVarChar,adParamOutput);
	pParam1->SetValue(34);
	//	pCommand->Append(pParam0); 
	pCommand->Append(pParam1); 
	pCommand->Append(pParam2);
	pCommand->Append(pParam3);
	CGuiRecordSet* m_rs1=pCommand->Execute();
	_variant_t idias;
	long nVal;
	pParam3->GetValue(szCad);
	pParam2->GetValue(nVal);
	int numFiles=m_rs1->GetNumFields();
	if (numFiles != 0)
	{
	m_rs1->MoveFirst();
		for (int i=0; i < numFiles; i++)
		{
			CGuiField field=m_rs1->GetField(i);
			//AfxMessageBox(field.GetName());
			CString strValue;
			field.GetValue(strValue);
		//	AfxMessageBox(strValue);
		}
	}
	m_rs1->Close();

*/	//-------------------------------------------------------------------------
	CGuiCommand* pCommand=new CGuiCommand();
	pCommand->SetActiveConnection(&m_cn);
	pCommand->SetCommandText("fcotest",adCmdStoredProc);
	/*
	create or replace procedure fcoTest(fecha1 in date, numero in number,fecha2 out date,resultado out number) IS
	BEGIN
	 fecha2:=fecha1;
	 resultado:=numero*23;
	END fcoTest; 
	*/
	CGuiParameter* pParam1=pCommand->CreateParameter(_T("fecha1"),sizeof(DATE),adDBTimeStamp);
	CGuiParameter* pParam2=pCommand->CreateParameter(_T("numero"),sizeof(long),adNumeric);
	CGuiParameter* pParam3=pCommand->CreateParameter(_T("fecha2"),sizeof(DATE),adDBTimeStamp,adParamOutput);
	CGuiParameter* pParam4=pCommand->CreateParameter(_T("resultado"),sizeof(long),adNumeric,adParamOutput);
	pParam1->SetValue(COleDateTime (2001,12,1,0,0,0));
	//	pCommand->Append(pParam0); 
	pCommand->Append(pParam1); 
	pParam2->SetValue(10);
	pCommand->Append(pParam2);
	
	pCommand->Append(pParam3); 
	pCommand->Append(pParam4);

	CGuiRecordSet* m_rs1=pCommand->Execute();
	CString  fecha1;
	long iVal;
	pParam3->GetFormatDate(fecha1);
	pParam4->GetValue(iVal);
	int numFiles=m_rs1->GetNumFields();
	if (numFiles != 0)
	{
	m_rs1->MoveFirst();
		for (int i=0; i < numFiles; i++)
		{
			CGuiField field=m_rs1->GetField(i);
			//AfxMessageBox(field.GetName());
			CString strValue;
			field.GetValue(strValue);
		//	AfxMessageBox(strValue);
		}
	}
	m_rs1->Close();

	//-------------------------------------------------------------------------

	  CGuiAdoTestDlg 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;
}