📄 商品销售管理系统.cpp
字号:
// 商品销售管理系统.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "商品销售管理系统.h"
#include "商品销售管理系统Dlg.h"
#include "DllHeader.h"
#include "RXADO.h"
#include "DLogin.h"
#include "MyDoc.h"
#include "MainPrint.h"
#include "MyView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CMyApp theApp;
HINSTANCE hInstance;
RxADO ado;
PrintStruct m_ps;
//CSingleDocTemplate* pDocTemplate;
/////////////////////////////////////////////////////////////////////////////
// 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 initialization
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=spxxglxt;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
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CMyDoc),
RUNTIME_CLASS(CMainPrint), // main SDI frame window
RUNTIME_CLASS(CMyView));
AddDocTemplate(pDocTemplate);
CDLogin dlg;
dlg.DoModal();
return FALSE;
}
int CMyApp::ExitInstance()
{
::AfxFreeLibrary(hInstance);
return CWinApp::ExitInstance();
}
void CMyApp::PrintSetup()
{
OnFilePrintSetup();
}
CString CMyApp::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;
}
void CMyApp::Print()
{
CMyApp * app=(CMyApp*)AfxGetApp();
main_Wnd=app->m_pMainWnd;
app->m_pDocManager->OnFileNew();
CMainPrint * temp=(CMainPrint*)app->m_pMainWnd;
temp->SetWindowText("打印");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -