本文整理汇总了C++中LoadStdProfileSettings函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadStdProfileSettings函数的具体用法?C++ LoadStdProfileSettings怎么用?C++ LoadStdProfileSettings使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LoadStdProfileSettings函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: AfxMessageBox
BOOL Ctask1App::InitInstance()
{
CWinAppEx::InitInstance();
// 初始化 OLE 库
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
EnableTaskbarInteraction(FALSE);
// 使用 RichEdit 控件需要 AfxInitRichEdit2()
// AfxInitRichEdit2();
// 标准初始化
// 如果未使用这些功能并希望减小
// 最终可执行文件的大小,则应移除下列
// 不需要的特定初始化例程
// 更改用于存储设置的注册表项
// TODO: 应适当修改该字符串,
// 例如修改为公司或组织名
SetRegistryKey(_T("应用程序向导生成的本地应用程序"));
LoadStdProfileSettings(4); // 加载标准 INI 文件选项(包括 MRU)
InitContextMenuManager();
InitKeyboardManager();
InitTooltipManager();
CMFCToolTipInfo ttParams;
ttParams.m_bVislManagerTheme = TRUE;
theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,
RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);
// 注册应用程序的文档模板。文档模板
// 将用作文档、框架窗口和视图之间的连接
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(Ctask1Doc),
RUNTIME_CLASS(CMainFrame), // 主 SDI 框架窗口
RUNTIME_CLASS(Ctask1View));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
// 分析标准 shell 命令、DDE、打开文件操作的命令行
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// 调度在命令行中指定的命令。如果
// 用 /RegServer、/Register、/Unregserver 或 /Unregister 启动应用程序,则返回 FALSE。
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// 唯一的一个窗口已初始化,因此显示它并对其进行更新
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
// 仅当具有后缀时才调用 DragAcceptFiles
// 在 SDI 应用程序中,这应在 ProcessShellCommand 之后发生
return TRUE;
}
开发者ID:latys,项目名称:task1,代码行数:71,代码来源:task1.cpp
示例2: GetModuleFileName
BOOL CRadiantApp::InitInstance() {
//g_hOpenGL32 = ::LoadLibrary("opengl32.dll");
// 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.
//AfxEnableMemoryTracking(FALSE);
#ifdef _AFXDLL
//Enable3dControls(); // Call this when using MFC in a shared DLL
#else
//Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// If there's a .INI file in the directory use it instead of registry
char RadiantPath[_MAX_PATH];
GetModuleFileName( NULL, RadiantPath, _MAX_PATH );
// search for exe
CFileFind Finder;
Finder.FindFile( RadiantPath );
Finder.FindNextFile();
// extract root
CString Root = Finder.GetRoot();
// build root\*.ini
CString IniPath = Root + "\\REGISTRY.INI";
// search for ini file
Finder.FindNextFile();
if( Finder.FindFile( IniPath ) ) {
Finder.FindNextFile();
// use the .ini file instead of the registry
free( ( void * )m_pszProfileName );
m_pszProfileName = _tcsdup( _T( Finder.GetFilePath() ) );
// look for the registry key for void* buffers storage ( these can't go into .INI files )
int i = 0;
CString key;
HKEY hkResult;
DWORD dwDisp;
DWORD type;
char iBuf[3];
do {
sprintf( iBuf, "%d", i );
key = "Software\\Q3Radiant\\IniPrefs" + CString( iBuf );
// does this key exists ?
if( RegOpenKeyEx( HKEY_CURRENT_USER, key, 0, KEY_ALL_ACCESS, &hkResult ) != ERROR_SUCCESS ) {
// this key doesn't exist, so it's the one we'll use
strcpy( g_qeglobals.use_ini_registry, key.GetBuffer( 0 ) );
RegCreateKeyEx( HKEY_CURRENT_USER, key, 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hkResult, &dwDisp );
RegSetValueEx( hkResult, "RadiantName", 0, REG_SZ, reinterpret_cast<CONST BYTE *>( RadiantPath ), strlen( RadiantPath ) + 1 );
RegCloseKey( hkResult );
break;
} else {
char RadiantAux[ _MAX_PATH ];
unsigned long size = _MAX_PATH;
// the key exists, is it the one we are looking for ?
RegQueryValueEx( hkResult, "RadiantName", 0, &type, reinterpret_cast<BYTE *>( RadiantAux ), &size );
RegCloseKey( hkResult );
if( !strcmp( RadiantAux, RadiantPath ) ) {
// got it !
strcpy( g_qeglobals.use_ini_registry, key.GetBuffer( 0 ) );
break;
}
}
i++;
} while( 1 );
g_qeglobals.use_ini = true;
} else {
// Change the registry key under which our settings are stored.
SetRegistryKey( EDITOR_REGISTRY_KEY );
g_qeglobals.use_ini = false;
}
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.
// CMultiDocTemplate* pDocTemplate;
// pDocTemplate = new CMultiDocTemplate(
// IDR_RADIANTYPE,
// RUNTIME_CLASS(CRadiantDoc),
// RUNTIME_CLASS(CMainFrame), // custom MDI child frame
// RUNTIME_CLASS(CRadiantView));
// AddDocTemplate(pDocTemplate);
// create main MDI Frame window
g_PrefsDlg.LoadPrefs();
glEnableClientState( GL_VERTEX_ARRAY );
CString strTemp = m_lpCmdLine;
strTemp.MakeLower();
if( strTemp.Find( "builddefs" ) >= 0 ) {
g_bBuildList = true;
}
CMainFrame *pMainFrame = new CMainFrame;
if( !pMainFrame->LoadFrame( IDR_MENU_QUAKE3 ) ) {
return FALSE;
}
if( pMainFrame->m_hAccelTable ) {
::DestroyAcceleratorTable( pMainFrame->m_hAccelTable );
}
pMainFrame->LoadAccelTable( MAKEINTRESOURCE( IDR_MINIACCEL ) );
m_pMainWnd = pMainFrame;
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow( m_nCmdShow );
pMainFrame->UpdateWindow();
//.........这里部分代码省略.........
开发者ID:SL987654,项目名称:The-Darkmod-Experimental,代码行数:101,代码来源:Radiant.cpp
示例3: AfxEnableControlContainer
BOOL CApp::InitInstance()
{
if(!CDCGFApp::InitInstance()) 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
*/
// 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("DEAD:CODE"));
LoadStdProfileSettings(8); // Load standard INI file options (including MRU)
CDCGFStringTable::Init();
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_PROJECTYPE,
RUNTIME_CLASS(CProjectDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CProjectView));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// Enable drag/drop open
//m_pMainWnd->DragAcceptFiles();
// This code replaces the MFC created menus with
// the Ownerdrawn versions
static UINT toolbars[]={
IDR_MAINFRAME, IDR_TOOLBAR_2
};
pDocTemplate->m_hMenuShared=pMainFrame->NewMenu(IDR_PROJECTYPE, toolbars, 2);
pMainFrame->m_hMenuDefault=pMainFrame->NewDefaultMenu(IDR_MAINFRAME, toolbars, 2);
/*
CDCGFStringTable::LocMenu(CMenu::FromHandle(pMainFrame->m_hMenuDefault));
CDCGFStringTable::LocMenu(CMenu::FromHandle(pDocTemplate->m_hMenuShared));
*/
// This simulates a window being opened if you don't have
// a default window displayed at startup
pMainFrame->OnUpdateFrameMenu(pMainFrame->m_hMenuDefault);
// Enable DDE Execute open
EnableShellOpen();
RegisterShellFileTypes(FALSE);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if(cmdInfo.m_nShellCommand==CCommandLineInfo::FileNew)
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(SW_SHOWMAXIMIZED);
pMainFrame->UpdateWindow();
if(cmdInfo.m_nShellCommand == CCommandLineInfo::FileNothing)
{
DoSomeNagging();
if(GetRegInt(HKEY_CURRENT_USER, DCGF_TOOLS_REG_PATH, "AutoCheckUpdates", 1))
{
pMainFrame->CheckForUpdates(true);
}
}
pMainFrame->UpdateMenuURL(pMainFrame->GetMenu());
return TRUE;
}
开发者ID:segafan,项目名称:wme1_jankavan_tlc_edition-repo,代码行数:98,代码来源:ProjectMan.cpp
示例4: sizeof
BOOL CDmTraceViewerApp::InitInstance()
{
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinAppEx::InitInstance();
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
EnableTaskbarInteraction();
// AfxInitRichEdit2() is required to use RichEdit control
// AfxInitRichEdit2();
// 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
// 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(8); // Load standard INI file options (including MRU)
InitContextMenuManager();
InitKeyboardManager();
InitTooltipManager();
CMFCToolTipInfo ttParams;
ttParams.m_bVislManagerTheme = TRUE;
theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,
RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(IDR_DmTraceViewerTYPE,
RUNTIME_CLASS(CDmTraceViewerDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CDmTraceViewerView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame || !pMainFrame->LoadFrame(IDR_MAINFRAME))
{
delete pMainFrame;
return FALSE;
}
m_pMainWnd = pMainFrame;
// call DragAcceptFiles only if there's a suffix
// In an MDI app, this should occur immediately after setting m_pMainWnd
// Enable drag/drop open
m_pMainWnd->DragAcceptFiles();
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Enable DDE Execute open
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// Dispatch commands specified on the command line. Will return FALSE if
// app was launched with /RegServer, /Register, /Unregserver or /Unregister.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
开发者ID:hlhtddx,项目名称:AndroidTrace,代码行数:94,代码来源:DmTraceViewer.cpp
示例5: sizeof
BOOL CLogicSimulator_1App::InitInstance()
{
// 응용 프로그램 매니페스트가 ComCtl32.dll 버전 6 이상을 사용하여 비주얼 스타일을
// 사용하도록 지정하는 경우, Windows XP 상에서 반드시 InitCommonControlsEx()가 필요합니다.
// InitCommonControlsEx()를 사용하지 않으면 창을 만들 수 없습니다.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// 응용 프로그램에서 사용할 모든 공용 컨트롤 클래스를 포함하도록
// 이 항목을 설정하십시오.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
EnableTaskbarInteraction(FALSE);
// RichEdit 컨트롤을 사용하려면 AfxInitRichEdit2()가 있어야 합니다.
// AfxInitRichEdit2();
// 표준 초기화
// 이들 기능을 사용하지 않고 최종 실행 파일의 크기를 줄이려면
// 아래에서 필요 없는 특정 초기화
// 루틴을 제거해야 합니다.
// 해당 설정이 저장된 레지스트리 키를 변경하십시오.
// TODO: 이 문자열을 회사 또는 조직의 이름과 같은
// 적절한 내용으로 수정해야 합니다.
SetRegistryKey(_T("로컬 응용 프로그램 마법사에서 생성된 응용 프로그램"));
LoadStdProfileSettings(4); // MRU를 포함하여 표준 INI 파일 옵션을 로드합니다.
// 응용 프로그램의 문서 템플릿을 등록합니다. 문서 템플릿은
// 문서, 프레임 창 및 뷰 사이의 연결 역할을 합니다.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CLogicSimulator_1Doc),
RUNTIME_CLASS(CMainFrame), // 주 SDI 프레임 창입니다.
RUNTIME_CLASS(CLogicSimulator_1View));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
// 표준 셸 명령, DDE, 파일 열기에 대한 명령줄을 구문 분석합니다.
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// DDE Execute 열기를 활성화합니다.
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// 명령줄에 지정된 명령을 디스패치합니다.
// 응용 프로그램이 /RegServer, /Register, /Unregserver 또는 /Unregister로 시작된 경우 FALSE를 반환합니다.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// 창 하나만 초기화되었으므로 이를 표시하고 업데이트합니다.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
// 접미사가 있을 경우에만 DragAcceptFiles를 호출합니다.
// SDI 응용 프로그램에서는 ProcessShellCommand 후에 이러한 호출이 발생해야 합니다.
// 끌어서 놓기에 대한 열기를 활성화합니다.
m_pMainWnd->DragAcceptFiles();
return TRUE;
}
开发者ID:phy0110,项目名称:LogicSimulator_MFC,代码行数:67,代码来源:LogicSimulator_1.cpp
示例6: InitLog
// CMatchAgentApp 초기화
BOOL CMatchAgentApp::InitInstance()
{
if (g_SingleRunController.Create(true) == false)
return FALSE;
/*
char szLogFileName[_MAX_DIR];
if (GetRecommandLogFileName(szLogFileName) == false)
return FALSE;
InitLog(MLOGSTYLE_DEBUGSTRING|MLOGSTYLE_FILE, szLogFileName);
*/
MRegistry::szApplicationName=APPLICATION_NAME;
if(m_ZFS.Create(".")==false){
AfxMessageBox("MAIET Zip File System Initialize Error");
return FALSE;
}
// 응용 프로그램 매니페스트가 ComCtl32.dll 버전 6 이상을 사용하여 비주얼 스타일을
// 사용하도록 지정하는 경우, Windows XP 상에서 반드시 InitCommonControls()가 필요합니다.
// InitCommonControls()를 사용하지 않으면 창을 만들 수 없습니다.
InitCommonControls();
CWinApp::InitInstance();
// OLE 라이브러리를 초기화합니다.
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
// 표준 초기화
// 이들 기능을 사용하지 않고 최종 실행 파일의 크기를 줄이려면
// 아래에서 필요 없는 특정 초기화 루틴을 제거해야 합니다.
// 해당 설정이 저장된 레지스트리 키를 변경하십시오.
// TODO: 이 문자열을 회사 또는 조직의 이름과 같은
// 적절한 내용으로 수정해야 합니다.
SetRegistryKey(_T("로컬 응용 프로그램 마법사에서 생성된 응용 프로그램"));
LoadStdProfileSettings(4); // MRU를 포함하여 표준 INI 파일 옵션을 로드합니다.
// 응용 프로그램의 문서 템플릿을 등록합니다. 문서 템플릿은
// 문서, 프레임 창 및 뷰 사이의 연결 역할을 합니다.
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(IDR_MatchAgentTYPE,
RUNTIME_CLASS(CMatchAgentDoc),
RUNTIME_CLASS(CChildFrame), // 사용자 지정 MDI 자식 프레임입니다.
RUNTIME_CLASS(COutputView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
m_pDocTemplateOutput = pDocTemplate;
// Template
m_pDocTemplateCmdLogView = new CMultiDocTemplate(IDR_MatchAgentTYPE,
RUNTIME_CLASS(CMatchAgentDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CCommandLogView));
// AddDocTemplate(m_pDocTemplateCmdLogView);
// 주 MDI 프레임 창을 만듭니다.
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame || !pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// 접미사가 있을 경우에만 DragAcceptFiles를 호출합니다.
// MDI 응용 프로그램에서는 m_pMainWnd를 설정한 후 바로 이러한 호출이 발생해야 합니다.
// 표준 셸 명령, DDE, 파일 열기에 대한 명령줄을 구문 분석합니다.
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// 명령줄에 지정된 명령을 디스패치합니다. 응용 프로그램이 /RegServer, /Register, /Unregserver 또는 /Unregister로 시작된 경우 FALSE를 반환합니다.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// 주 창이 초기화되었으므로 이를 표시하고 업데이트합니다.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
开发者ID:roseon,项目名称:life-marvelous,代码行数:80,代码来源:MatchAgent.cpp
示例7: sizeof
BOOL CSysCtrlApp::InitInstance()
{
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CBCGPWinApp::InitInstance();
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_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
// 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("BCGP AppWizard-Generated Applications"));
LoadStdProfileSettings(4); // Load standard INI file options (including MRU)
SetRegistryBase(_T("Settings"));
// Initialize all Managers for usage. They are automatically constructed
// if not yet present
// 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(CSysCtrlDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CSysCtrlView));
if (!pDocTemplate)
return FALSE;
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;
// The one and only window has been initialized, so show and update it
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
// call DragAcceptFiles only if there's a suffix
// In an SDI app, this should occur after ProcessShellCommand
//LOGFONT logfont = { 0 };
//::SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &logfont, 0);
//logfont.lfHeight = logfont.lfHeight * 10;
////strcpy(logfont.lfFaceName ,"΢ÈíÑźÚ");
//::afxGlobalData.SetMenuFont(&logfont, true);
return TRUE;
}
开发者ID:1059444127,项目名称:SysCtrl,代码行数:79,代码来源:SysCtrl.cpp
示例8: Enable3dControls
BOOL CDynamoRIOApp::InitInstance()
{
#ifndef DRSTATS_DEMO
TCHAR msg[MAX_PATH*2];
#endif
BOOL windows_NT;
// 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.
if (!CheckWindowsVersion(windows_NT)) {
// abort
return FALSE;
}
#if 0 // warning C4996: 'CWinApp::Enable3dControlsStatic': CWinApp::Enable3dControlsStatic is no longer needed. You should remove this call.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
#endif
#ifndef DRSTATS_DEMO
// Change the registry key under which our settings are stored,
// including MRU
SetRegistryKey(L_DYNAMORIO_REGISTRY_KEY);
LoadStdProfileSettings(12); // Load standard INI file options (including MRU)
#endif
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
#ifdef DRSTATS_DEMO
IDR_MAINFRAME_DEMO,
#else
IDR_MAINFRAME,
#endif
RUNTIME_CLASS(CDynamoRIODoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CDynamoRIOView));
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;
// enable file manager drag/drop and DDE Execute open
m_pMainWnd->DragAcceptFiles();
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
// I can't find any other way to access the main frame
m_pMainFrame = (CMainFrame *) m_pMainWnd;
// I can't figure out how to disable a menu item that has a command
// handler when this var is set, so I disable it:
m_pMainFrame->m_bAutoMenuEnable = FALSE;
#ifndef DRSTATS_DEMO
m_bSystemwideAllowed = TRUE;
// set the string we'll put into the registry key to inject system-wide
TCHAR data[1024];
int len = GetEnvironmentVariable(_T("DYNAMORIO_HOME"), m_dynamorio_home, _MAX_DIR);
#if 1 //NOCHECKIN
if (len == 0)
m_dynamorio_home[0] = _T('\0');
#else
if (len == 0) {
int res = MessageBox(NULL,
_T("DYNAMORIO_HOME environment variable not found.\n")
_T("Set all the DynamoRIO environment variables to their default values?\n")
_T("(Otherwise this GUI cannot operate and must exit.)"),
_T("DynamoRIO Not Configured for Current User"), MB_YESNO | MYMBFLAGS);
if (res == IDYES) {
if (!ConfigureForNewUser())
return FALSE;
} else {
// abort
return FALSE;
}
}
#endif
if (windows_NT) {
// we don't support systemwide on NT
// hack: use "confirm systemwide" setting to decide whether to notify user
if (GetProfileInt(_T("Settings"), _T("Confirm Systemwide"), 1) == 1) {
//.........这里部分代码省略.........
开发者ID:cherry-wb,项目名称:dr-vis,代码行数:101,代码来源:DynamoRIO.cpp
示例9: sizeof
BOOL CCircleApp::InitInstance()
{
// InitCommonControlsEx() требуются для Windows XP, если манифест
// приложения использует ComCtl32.dll версии 6 или более поздней версии для включения
// стилей отображения. В противном случае будет возникать сбой при создании любого окна.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Выберите этот параметр для включения всех общих классов управления, которые необходимо использовать
// в вашем приложении.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
// Инициализация библиотек OLE
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
EnableTaskbarInteraction(FALSE);
// Для использования элемента управления RichEdit требуется метод AfxInitRichEdit2()
// AfxInitRichEdit2();
// Стандартная инициализация
// Если эти возможности не используются и необходимо уменьшить размер
// конечного исполняемого файла, необходимо удалить из следующего
// конкретные процедуры инициализации, которые не требуются
// Измените раздел реестра, в котором хранятся параметры
// TODO: следует изменить эту строку на что-нибудь подходящее,
// например на название организации
SetRegistryKey(_T("Локальные приложения, созданные с помощью мастера приложений"));
LoadStdProfileSettings(4); // Загрузите стандартные параметры INI-файла (включая MRU)
// Зарегистрируйте шаблоны документов приложения. Шаблоны документов
// выступают в роли посредника между документами, окнами рамок и представлениями
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CCircleDoc),
RUNTIME_CLASS(CMainFrame), // основное окно рамки SDI
RUNTIME_CLASS(CCircleView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
// Разрешить использование расширенных символов в горячих клавишах меню
CMFCToolBar::m_bExtCharTranslation = TRUE;
// Синтаксический разбор командной строки на стандартные команды оболочки, DDE, открытие файлов
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Включить открытие выполнения DDE
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// Команды диспетчеризации, указанные в командной строке. Значение FALSE будет возвращено, если
// приложение было запущено с параметром /RegServer, /Register, /Unregserver или /Unregister.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// Одно и только одно окно было инициализировано, поэтому отобразите и обновите его
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
// вызов DragAcceptFiles только при наличии суффикса
// В приложении SDI это должно произойти после ProcessShellCommand
// Включить открытие перетаскивания
m_pMainWnd->DragAcceptFiles();
return TRUE;
}
开发者ID:walleri18,项目名称:MFC_Catalog,代码行数:79,代码来源:Circle.cpp
示例10: AfxInitRichEdit
BOOL CCloneDetectorGUIApp::InitInstance()
{
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
AfxInitRichEdit();
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinAppEx::InitInstance();
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
EnableTaskbarInteraction(FALSE);
// AfxInitRichEdit2() is required to use RichEdit control
// AfxInitRichEdit2();
// 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
// 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(4); // Load standard INI file options (including MRU)
InitContextMenuManager();
InitKeyboardManager();
InitTooltipManager();
CMFCToolTipInfo ttParams;
ttParams.m_bVislManagerTheme = TRUE;
theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,
RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(IDR_MAINFRAME, //IDR_CloneDetectorGUTYPE,
RUNTIME_CLASS(ClonePairsAsmDoc),
RUNTIME_CLASS(ClonePairsAsmFrame), // custom MDI child frame
RUNTIME_CLASS(ClonePairsAsmView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
m_pDocTemplateTokenRef = new CMultiDocTemplate(IDR_MAINFRAME, //IDR_TOKEN_REF_MENU,
RUNTIME_CLASS(CTokenRefDoc),
RUNTIME_CLASS(CTokenRefFrm), // custom MDI child frame
RUNTIME_CLASS(ClonePairsAsmView));
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame || !pMainFrame->LoadFrame(IDR_MAINFRAME))
{
delete pMainFrame;
return FALSE;
}
m_pMainWnd = pMainFrame;
// call DragAcceptFiles only if there's a suffix
// In an MDI app, this should occur immediately after setting m_pMainWnd
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
//m_initFragStr = "This is line one\r\nThis is line two\r\n";
CCmdLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if( cmdInfo.m_fragmentTmpFile && !cmdInfo.m_strFileName.IsEmpty())
//if(cmdInfo.m_fragmentTmpFile == true)
{
//TODO IDA PRO PLUGIN HERE
readFragFromFile(cmdInfo.m_strFileName,m_initFragStr);
//m_initFragStr = cmdInfo.m_strFileName; //"This is line one\r\nThis is line two\r\n";
OnFileNewSearchCodeFrag();
}
return TRUE;
}
开发者ID:AmesianX,项目名称:BinClone,代码行数:99,代码来源:CloneDetectorGUI.cpp
示例11: sizeof
BOOL CUIDesignerApp::InitInstance()
{
// 如果一个运行在 Windows XP 上的应用程序清单指定要
// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
//则需要 InitCommonControlsEx()。否则,将无法创建窗口。
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// 将它设置为包括所有要在应用程序中使用的
// 公共控件类。
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinAppEx::InitInstance();
// 初始化 OLE 库
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
// 标准初始化
// 如果未使用这些功能并希望减小
// 最终可执行文件的大小,则应移除下列
// 不需要的特定初始化例程
// 更改用于存储设置的注册表项
// TODO: 应适当修改该字符串,
// 例如修改为公司或组织名
SetRegistryKey(_T(""));
LoadStdProfileSettings(); // 加载标准 INI 文件选项(包括 MRU)
SetRegistryBase(_T("Settings"));
CPaintManagerUI::LoadPlugin(_T("mgyUI_Plugin.dll"));
InitContextMenuManager();
InitKeyboardManager();
InitTooltipManager();
CMFCToolTipInfo ttParams;
ttParams.m_bVislManagerTheme = TRUE;
theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,
RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);
// 注册应用程序的文档模板。文档模板
// 将用作文档、框架窗口和视图之间的连接
m_pUIDocTemplate = new CMultiDocTemplate(IDR_UIDESIGNER,
RUNTIME_CLASS(CUIDesignerDoc),
RUNTIME_CLASS(CChildFrame), // 自定义 MDI 子框架
RUNTIME_CLASS(CUIDesignerView));
if (!m_pUIDocTemplate)
return FALSE;
AddDocTemplate(m_pUIDocTemplate);
// 创建主 MDI 框架窗口
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame || !pMainFrame->LoadFrame(IDR_MAINFRAME))
{
delete pMainFrame;
return FALSE;
}
m_pMainWnd = pMainFrame;
// 仅当具有后缀时才调用 DragAcceptFiles
// 在 MDI 应用程序中,这应在设置 m_pMainWnd 之后立即发生
// 启用拖/放
m_pMainWnd->DragAcceptFiles();
// 启用“DDE 执行”
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// 主窗口已初始化,因此显示它并对其进行更新
pMainFrame->ShowWindow(SW_SHOWMAXIMIZED);
pMainFrame->UpdateWindow();
return TRUE;
}
开发者ID:zephyrer,项目名称:my-duilibex-soc,代码行数:77,代码来源:UIDesigner.cpp
示例12: memset
//.........这里部分代码省略.........
// Pour utilisation de RichEditCtrl
AfxEnableControlContainer();
AfxInitRichEdit();
// InitCommonControlsEx() est requis sur Windows XP si le manifeste de l'application
// spécifie l'utilisation de ComCtl32.dll version 6 ou ultérieure pour activer les
// styles visuels. Dans le cas contraire, la création de fenêtres échouera.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// À définir pour inclure toutes les classes de contrôles communs à utiliser
// dans votre application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
InitContextMenuManager();
InitShellManager();
InitKeyboardManager();
InitTooltipManager();
CMFCToolTipInfo ttParams;
ttParams.m_bVislManagerTheme = TRUE;
GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL, RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);
// enregistrement Scintilla
#ifndef SCINTILLA_DLL
Scintilla_RegisterClasses(AfxGetInstanceHandle());
Scintilla_LinkLexers();
#endif
// Supprime pour la gestion multi-lingues
// CWinAppEx::InitInstance();
// Initialisation standard
// Si vous n'utilisez pas ces fonctionnalités et que vous souhaitez réduire la taille
// de votre exécutable final, vous devez supprimer ci-dessous
// les routines d'initialisation spécifiques dont vous n'avez pas besoin.
// Changez la clé de Registre sous laquelle nos paramètres sont enregistrés
// TODO : modifiez cette chaîne avec des informations appropriées,
// telles que le nom de votre société ou organisation
SetRegistryKey(m_versionInfos.GetCompanyName().c_str());
//First free the string allocated by MFC at CWinApp startup.
//The string is allocated before InitInstance is called.
free((void*)m_pszProfileName);
//Change the name of the .INI file.
//The CWinApp destructor will free the memory.
// Ce nom est utilise pour la sauvegarde des parametres
strReg = m_versionInfos.GetProductName() + "MFCFP";
m_pszProfileName = _tcsdup(strReg.c_str());
LoadStdProfileSettings(4); // Charge les options de fichier INI standard (y compris les derniers fichiers utilisés)
// Inscrire les modèles de document de l'application. Ces modèles
// lient les documents, fenêtres frame et vues entre eux
// creation du manager de doc specifique afin de gerer specifiquement les repertoires
// de sauvegarde des diffents documents.
// cf http://www.codeguru.com/cpp/w-d/dislog/commondialogs/article.php/c1967
m_pDocManager = new COngTVDocManager;
// Creation doc template pour les scripts LUA (uniquement si DLL scintilla disponible)
if (NULL != m_hSciDLL)
{
m_pNewLuaDocTemplate = new CMultiDocTemplate( IDR_LUATYPE
, RUNTIME_CLASS(CLuaDoc)
, RUNTIME_CLASS(CLuaChildFrame)
, RUNTIME_CLASS(CLuaView)
);
if (!m_pNewLuaDocTemplate)
return FALSE;
AddDocTemplate(m_pNewLuaDocTemplate);
}
// Installe la police DINA
HRSRC hRes = FindResource(NULL, MAKEINTRESOURCE(IDR_DINA), _T("DINA"));
PVOID lpFont = LockResource(LoadResource(NULL, hRes));
DWORD dwSize = SizeofResource(NULL, hRes), cFonts = 0;
m_hDinaFont = AddFontMemResourceEx(lpFont, dwSize, NULL, &cFonts);
ASSERT(cFonts > 0);
// crée la fenêtre frame MDI principale
CMainFrame* pMainFrame = new CMainFrame;
// On parse la ligne de commande
CCmdLine cmdLine;
cmdLine.SplitLine(__argc, __argv);
// On indique le fichier de configuration ("" par defaut)
std::string configFileName = cmdLine.GetSafeArgument("-cnx", 0, "");
pMainFrame->SetConfigFile(configFileName);
m_pMainWnd = pMainFrame;
if (!pMainFrame || !pMainFrame->LoadFrame(IDR_MAINFRAME))
{
delete pMainFrame;
return FALSE;
}
// La fenêtre principale a été initialisée et peut donc être affichée et mise à jour
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
开发者ID:drupalhunter-team,项目名称:TrackMonitor,代码行数:101,代码来源:OngTV.cpp
示例13: sizeof
//.........这里部分代码省略.........
AfxMessageBox(_T("Password"));
}
file=(CInternetFile*)session.OpenURL(_T("www.temcocontrols.com/ftp/software/T3000_Version.txt"));
}
catch (CInternetException* e)
{
file=NULL;
e->Delete();
}
CString version;
if (file)
{
while(file->ReadString(version)!=NULL){
}
AfxMessageBox(version);
}
#endif
#endif
// 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
// 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("Temco T3000 Application"));//
LoadStdProfileSettings(); // Load standard INI file options (including MRU)//
InitContextMenuManager();
InitKeyboardManager();
InitTooltipManager();
CMFCToolTipInfo ttParams;
ttParams.m_bVislManagerTheme = TRUE;
theApp.GetTooltipManager()->SetTooltipParams(AFX_TOOLTIP_TYPE_ALL,
RUNTIME_CLASS(CMFCToolTipCtrl), &ttParams);
#if 1
hr=CoInitialize(NULL);//
if(FAILED(hr)) //
{
AfxMessageBox(_T("Error Initialize the COM Interface"));//
return FALSE;//
}
#endif
}
catch (...)
{
AfxMessageBox(_T("Database operation to stop!"));
}
CString registerfilename;
registerfilename=g_strExePth+_T("REG_msado15.bat");
// ::ShellExecute(NULL, _T("open"), registerfilename.GetBuffer(), _T(""), _T(""), SW_HIDE);
registerfilename=g_strExePth+_T("REG_MSFLXGRD.bat");
//::ShellExecute(NULL, _T("open"), registerfilename.GetBuffer(), _T(""), _T(""), SW_HIDE);
开发者ID:jay-github,项目名称:T3000_Building_Automation_System,代码行数:67,代码来源:T3000.cpp
示例14: sizeof
BOOL CMiniDebuggerApp::InitInstance()
{
// InitCommonControlsEx() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// Set this to include all the common control classes you want to use
// in your application.
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinApp::InitInstance();
// Initialize OLE libraries
if (!AfxOleInit())
{
AfxMessageBox(IDP_OLE_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
// 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(4); // 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(CMiniDebuggerDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMiniDebuggerView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line. Will return FALSE if
// app was launched with /RegServer, /Register, /Unregserver or /Unregister.
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The one and only window has been initialized, so show and update it
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
// call DragAcceptFiles only if there's a suffix
// In an SDI app, this should occur after ProcessShellCommand
return TRUE;
}
开发者ID:nicolascormier,项目名称:ncormier-academic-projects,代码行数:61,代码来源:MiniDebugger.cpp
示例15: sizeof
BOOL CRWDSClientApp::InitInstance()
{
// 如果一个运行在 Windows XP 上的应用程序清单指定要
// 使用 ComCtl32.dll 版本 6 或更高版本来启用可视化方式,
//则需要 InitCommonControlsEx()。否则,将无法创建窗口。
INITCOMMONCONTROLSEX InitCtrls;
InitCtrls.dwSize = sizeof(InitCtrls);
// 将它设置为包括所有要在应用程序中使用的
// 公共控件类。
InitCtrls.dwICC = ICC_WIN95_CLASSES;
InitCommonControlsEx(&InitCtrls);
CWinAppEx::InitInstance();
CLogin login;
if(login.DoModal() == IDCANCEL)
return FALSE;
m_LoginAccount = login.GetLoginAccount();
m_LoginPassword = login.GetLoginPassword();
m_LoginOrgID = login.GetLoginOrgID();
m_LoginPermission = log
|
请发表评论