📄 filebrowser.cpp
字号:
/*
Filename : FileBrowser.cpp
Part of : File Browser
Description : Implementation of File Browser's application class
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 "FileBrowser.h"
#include "FileBrowserDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//===================================================================
// CFileBrowserApp
BEGIN_MESSAGE_MAP(CFileBrowserApp, CWinApp)
//{{AFX_MSG_MAP(CFileBrowserApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
//===================================================================
// CFileBrowserApp construction
CFileBrowserApp::CFileBrowserApp()
{
}
//===================================================================
// The one and only CFileBrowserApp object
CFileBrowserApp theApp;
//===================================================================
// CFileBrowserApp initialization
BOOL CFileBrowserApp::InitInstance()
{
AfxEnableControlContainer();
// Initialize Nokia PC Connectivity API
DWORD dwRet = CONA_OK;
// Initialize Device Management API
dwRet = DMAPI_Initialize(DMAPI_VERSION_32, NULL);
if (dwRet != CONA_OK)
{
ErrorMessageDlg(_T("Error initializing DMAPI"), dwRet);
return false;
}
// Initialize FS Functions API
dwRet = FSAPI_Initialize(FSAPI_VERSION_32, NULL);
if (dwRet != CONA_OK)
{
ErrorMessageDlg(_T("Error initializing FSAPI"), dwRet);
DMAPI_Terminate(NULL);
return false;
}
// Initialize Common Functions API
dwRet = CFAPI_Initialize(CFAPI_VERSION_10, NULL);
if (dwRet != CONA_OK)
{
ErrorMessageDlg(_T("Error initializing CFAPI"), dwRet);
DMAPI_Terminate(NULL);
FSAPI_Terminate(NULL);
return false;
}
CFileBrowserDlg dlg;
m_pMainWnd = &dlg;
// Show dialog
dlg.DoModal();
// Terminate Device Management API
DMAPI_Terminate(NULL);
// Terminate Filesystem Functions API
FSAPI_Terminate(NULL);
// Terminate Media Functions API
CFAPI_Terminate(NULL);
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -