我在APP中加入InitializeSkin(_T("XPCorona.ssk"));
运行可以出现带皮肤的程序。。可是过了一下子,马上就自动退出程序了。。这是怎么一回事??
把这句注释掉 程序正常运行
运行可以出现带皮肤的程序。。可是过了一下子,马上就自动退出程序了。。这是怎么一回事??
把这句注释掉 程序正常运行
解决方案 »
- 能不能用字符串资源保存密码
- 这些进程中哪些可能是病毒?
- vc函数问题
- 如何判断EDITBOX的状态,是可用还是不可用?
- ShellExecute中的参数lpParameters怎么用?
- 菜鸟的问题,
- VC做客户端用socket连接到java写的服务器端~~~可以么
- 我的机子不能运行蚂蚁,FLASHGET,STREAMVCR,FOXMAIL.WHY?
- 如何从.ini文件得到键名??
- LINUX下socket通信问题?
- 点击按钮出现窗口,当鼠标不在新窗口时,窗口自动消失,如何实现?
- http post文件,HttpSendRequestEx报错error_http_header_not_found?
代码就是在应用程序类添加了一天初始化语句BOOL CMyApp::InitInstance()
{
AfxEnableControlContainer();
//这条是添加的
InitializeSkin(_T("XPCorona.ssk"));
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
}
BOOL CTestSDIApp::InitInstance()
{
/*
{ // BLOCK: doc template registration
// Register the document template. Document templates serve
// as the connection between documents, frame windows and views.
// Attach this form to another document or frame window by changing
// the document or frame class in the constructor below.
CSingleDocTemplate* pNewDocTemplate = new CSingleDocTemplate(
IDR_TESTSDIFORMVIEW_TMPL,
RUNTIME_CLASS(CTestSDIDoc), // document class
RUNTIME_CLASS(CMainFrame), // frame class
RUNTIME_CLASS(CTestSDIFormView)); // view class
AddDocTemplate(pNewDocTemplate);
}
*/ 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")); 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.
//--------------------------------------------------------------------------
InitializeSkin(_T("XPCorona.ssk")); //Very good
// InitializeSkin(_T("Minimized.ssk")); //Very good
// InitializeSkin(_T("SoftCrystal.ssk")); //Very good CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CTestSDIDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CTestSDIView));
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(); return TRUE;
}这个是 skin++ 原版例子你看看~···
{
CDialog::OnInitDialog();// InitializeSkin("XPCorona.ssk");
// LoadSkin(_T("XPCorona.ssk"));
// Add "About..." menu item to system menu. // IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000); CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
} // Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here CTime t = CTime::GetCurrentTime();
CString str;
str.Format("µ±Ç°Ê±¼äΪ£º%dÄê%dÔÂ%dÈÕ%dʱ%d·Ö%dÃë",t.GetYear(),t.GetMonth(),t.GetDay(),t.GetHour(),t.GetMinute(),t.GetSecond());
SetDlgItemText(IDC_CURRENTTIME,str);
SetTimer(1,1000,NULL); // 我把这行注释掉就可以运行了。。
MinuteSet(); m_menu.LoadMenu(IDR_MENU1);
SetMenu(&m_menu);
return TRUE; // return TRUE unless you set the focus to a control
}