📄 applicationinstaller.cpp
字号:
/*
Filename : Installer.cpp
Part of : Application installer
Description : Implementation of application class inherited from CWinApp
Version : 3.2
This example is only to be used with PC Connectivity API version 3.2.
Compability ("as is") with future versions is not quaranteed.
Copyright (c) 2007 Nokia Corporation.
This material, including but not limited to documentation and any related
computer programs, is protected by intellectual property rights of Nokia
Corporation and/or its licensors.
All rights are reserved. Reproducing, modifying, translating, or
distributing any or all of this material requires the prior written consent
of Nokia Corporation. Nokia Corporation retains the right to make changes
to this material at any time without notice. A copyright license is hereby
granted to download and print a copy of this material for personal use only.
No other license to any other intellectual property rights is granted. The
material is provided "as is" without warranty of any kind, either express or
implied, including without limitation, any warranty of non-infringement,
merchantability and fitness for a particular purpose. In no event shall
Nokia Corporation be liable for any direct, indirect, special, incidental,
or consequential loss or damages, including but not limited to, lost profits
or revenue,loss of use, cost of substitute program, or loss of data or
equipment arising out of the use or inability to use the material, even if
Nokia Corporation has been advised of the likelihood of such damages occurring.
*/
#include "stdafx.h"
#include "ApplicationInstaller.h"
#include "ApplicationInstallerDlg.h"
#include "PCCSUtils.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//===================================================================
// The one and only CApplicationInstallerApp object
//
//===================================================================
CApplicationInstallerApp theApp;
//===================================================================
// Messagemap
//
//===================================================================
BEGIN_MESSAGE_MAP(CApplicationInstallerApp, CWinApp)
//{{AFX_MSG_MAP(CApplicationInstallerApp)
//}}AFX_MSG
END_MESSAGE_MAP()
//===================================================================
// Constructor
//
//===================================================================
CApplicationInstallerApp::CApplicationInstallerApp()
{
}
//===================================================================
// InitInstance()
//
// Initializes PC Suite Connectivity API and starts user interface dialog
//
//===================================================================
BOOL CApplicationInstallerApp::InitInstance()
{
#ifdef _AFXDLL
// deprecated
// Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
DWORD dwRet = CONA_OK;
// Initialize COM library as single-thread apartment before initializing PC Suite API.
// If COM library is not initialized, PC Suite API initializes it as multi-threaded
// object concurrency. However, GetOpenFileName(), GetSaveFileName() or MFC CFileDialog
// won't necessarily work in Windows 2000 SP 4, if called from multi-threaded apartment
// (common file dialog does not open, and application freezes).
// PC Suite API works in both modes, so lets initialize COM library as single-threaded
// apartment, to make sure all windows common dialogs work properly in all systems.
CoInitializeEx( NULL, COINIT_APARTMENTTHREADED);
dwRet = DMAPI_Initialize(DMAPI_VERSION_30, NULL);
if (dwRet != CONA_OK)
{
ErrorMessageDlg(_T("ERROR: unable to initialize DMAPI."), dwRet);
return FALSE;
}
if(dwRet == CONA_OK)
{
// Create and open application main window
CApplicationInstallerDlg* dlg = new CApplicationInstallerDlg;
m_pMainWnd = dlg;
dlg->DoModal();
delete dlg;
}
else
{
ErrorMessageDlg(_T("CONAInitialize"), dwRet);
}
DMAPI_Terminate(NULL);
CoUninitialize();
return FALSE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -