奉化幼儿园招生:AfxEnableControlContainer();是干什么的

来源:百度文库 编辑:高考问答 时间:2024/04/23 16:18:39
BOOL CMyApp::InitInstance()
{
AfxEnableControlContainer();

AfxOleInit();

//检验msado15.dll和data.mdb
char dir[256];
::GetModuleFileName(NULL,dir,256);
CString path=dir;
path=path.Left(path.ReverseFind('\\')+1);

/*
if(::GetFileAttributes(path+"msado15.dll")==-1)
{
AfxMessageBox("找不到 msado15.dll 文件!");
return FALSE;
}
*/

if(::GetFileAttributes(path+"data.mdb")==-1)
{
AfxMessageBox("找不到 data.mdb 文件!");
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

// 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(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(CMyDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CMyView));
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.
int my=::GetSystemMetrics(SM_CYSCREEN);
//根据当前分辨率自动选择窗口大小
if(my<650)
m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
else
m_pMainWnd->ShowWindow(SW_SHOW);

m_pMainWnd->UpdateWindow();

return TRUE;
}

AfxEnableControlContainer()函数是允许应用程序作为控件容器来使用

去查一上MSDN