15,979
社区成员
发帖
与我相关
我的任务
分享
CWinApp::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
// 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;
if (!pFrame)
return FALSE;
m_pMainWnd = pFrame;
//////////////////////////////////////////////////////////////////////////
char szAppPath[MAX_PATH];
GetModuleFileName(GetModuleHandle(NULL), szAppPath, MAX_PATH);
char *pXmlFile = strrchr(szAppPath, '\\');
if (pXmlFile)
{
*pXmlFile = '\0';
pXmlFile = strrchr(szAppPath, '\\');
if (pXmlFile)
{
pXmlFile++;
*pXmlFile = '\0';
#if _MSC_VER >= 1400
strcat_s(szAppPath, "skin\\NewYear\\config.xml");
#else
strcat(szAppPath, "skin\\NewYear\\config.xml");
#endif
BodSoftDirectUIVerify();
m_pWindowManager = (duWindowManager *)duLoadStyle(szAppPath);
}
}
// create and load the frame with its resources
pFrame->Create(NULL, _T("FirstUI"));
// The one and only window has been initialized, so show and update it
pFrame->ShowWindow(SW_SHOW);
pFrame->UpdateWindow();
// call DragAcceptFiles only if there's a suffix
// In an SDI app, this should occur after ProcessShellCommand