?? gdzc.cpp
字號:
// gdzc.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "gdzc.h"
#include "gdzcDlg.h"
#include "DllHeader.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMyApp
BEGIN_MESSAGE_MAP(CMyApp, CWinApp)
//{{AFX_MSG_MAP(CMyApp)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CMyApp construction
CMyApp::CMyApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CMyApp object
CMyApp theApp;
RxADO ado;
HINSTANCE hInstance;
/////////////////////////////////////////////////////////////////////////////
// CMyApp initialization
/*
*/
CString ShowPath()
{
CString ReturnPach;
TCHAR szPath[_MAX_PATH];
BROWSEINFO bi;
bi.hwndOwner=NULL;
bi.pidlRoot=NULL;
bi.lpszTitle=_T("請選擇一個文件夾");
bi.pszDisplayName=szPath;
bi.ulFlags=BIF_RETURNONLYFSDIRS;
bi.lpfn=NULL;
bi.lParam=NULL;
LPITEMIDLIST pItemIDList=SHBrowseForFolder(&bi);
if(pItemIDList)
{
if(SHGetPathFromIDList(pItemIDList,szPath))
ReturnPach=szPath;
}
else
ReturnPach="";
return ReturnPach;
}
/*
保留指定位數的小數位
*/
CString Format(float fCount, int nPlace)
{
CString sStr;
sStr.Format("%f",fCount);
int npla=sStr.Find(".");
if(npla==-1)
return sStr;
npla=npla+nPlace+1;
sStr=sStr.Left(npla);
return sStr;
}
BOOL CMyApp::InitInstance()
{
AfxEnableControlContainer();
//載入動態庫
hInstance =LoadLibrary("RxDLL.dll");
//載入RXDLL中的函數
MoneyToChineseCode=(_MoneyToChineseCode*)GetProcAddress(hInstance,"MoneyToChineseCode");
CTimeToCString=(_CTimeToCString*)GetProcAddress(hInstance,"CTimeToCString");
CStringTOCTime=(_CStringTOCTime*)GetProcAddress(hInstance,"CStringTOCTime");
Padl=(_Padl*)GetProcAddress(hInstance,"Padl");
CharToLetterCode=(_CharToLetterCode*)GetProcAddress(hInstance,"CharToLetterCode");
if(ado.SetConnection("Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=gdzc;Data Source=(local)")==false)
return false;
cnn=ado.GetConnection();
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CMyDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
int CMyApp::ExitInstance()
{
FreeLibrary(hInstance);
cnn=NULL;
ado.Close();
return CWinApp::ExitInstance();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -