📄 childview.cpp
字号:
// ChildView.cpp : implementation file
//
#include "afxwin.h"
#include "stdafx.h"
#include "MyPrinter.h"
#include "ChildView.h"
#include "MyClass.h"
#include "time.h"//xianyun
#include "WINSPOOL.H"//xianyun
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CChildView, CWrapperView)
/////////////////////////////////////////////////////////////////////////////
// CChildView
CChildView::CChildView()
{
HRESULT hr;
//初始化连接指针
CoInitialize(NULL);
hr=p_connect.CreateInstance(_uuidof(Connection));
if(FAILED(hr))
{
CWnd::MessageBox ("_ConnectionPtr初始化错误!");
}
//初始化recordset指针
hr=p_recordset.CreateInstance(_uuidof(Recordset));
if(FAILED(hr))
{
CWnd::MessageBox ("_RecordsetPtr初始化错误!");
}
}
CChildView::~CChildView()
{
CMyClass::b_BeingPreview =FALSE;//将打印预览位置位
}
BEGIN_MESSAGE_MAP(CChildView,CWrapperView)
//{{AFX_MSG_MAP(CChildView)
ON_WM_PAINT()
ON_COMMAND(ID_FILE_PRINT, OnFilePrint)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChildView message handlers
BOOL CChildView::PreCreateWindow(CREATESTRUCT& cs)
{
if (!CWnd::PreCreateWindow(cs))
return FALSE;
cs.dwExStyle |= WS_EX_CLIENTEDGE;
cs.style &= ~WS_BORDER;
cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS,
::LoadCursor(NULL, IDC_ARROW), HBRUSH(COLOR_WINDOW+1), NULL);
return TRUE;
}
void CChildView::OnPaint()
{
CPaintDC dc(this); // device context for painting
OnDraw(&dc);
// Do not call CWnd::OnPaint() for painting messages
}
void CChildView::OnDraw(CDC* pDC)
{
//CRect client;
//GetClientRect(&client);
//client.DeflateRect(50,50);
//CBrush brush(RGB(255,0,0));
//pDC->FillRect(&client,&brush);
//pDC->TextOut(200,200,"闲云");
//pDC->TextOut(200,200,"asfasdfsdfsdf");
//-------------------------------------------------
int x_long,y_long;
int x_start,y_start;
int i=0;
CString strTemp;
_variant_t variant;
CString strMoney;
CString strMoneyAmount;
double double_money=0.0;
CRect rc;
GetClientRect (&rc);
//HWND hwnd=CWnd::GetSafeHwnd ();
//创建画笔
CPen pen_thick,pen_thin;
pen_thick.CreatePen (PS_SOLID,2,RGB(0,0,0));
pen_thin.CreatePen (PS_SOLID,1,RGB(0,0,0));
static LOGFONT myfont;
myfont.lfHeight =20;
myfont.lfWidth =10;
myfont.lfWeight =50;
myfont.lfCharSet =255;
myfont.lfCharSet =GB2312_CHARSET;
pDC->SetTextColor ((COLORREF)0X000000000);
CFont newfont,*oldfont;
newfont.CreateFontIndirect (&myfont);
// newfont_l.CreateFontIndirect (&myfont_l);
// CFont ;
//font1.CreateFont(-MulDiv(1,-pDC->GetDeviceCaps(LOGPIXELSY),72),
// 0,0,0,FW_NORMAL,0,0,0,GB2312_CHARSET,
// OUT_STROKE_PRECIS,CLIP_STROKE_PRECIS,DRAFT_QUALITY,
// VARIABLE_PITCH|FF_SWISS,_T("黑体"));
// font2.CreateFont(-MulDiv(2,-pDC->GetDeviceCaps(LOGPIXELSY),72),
// 0,0,0,FW_NORMAL,0,0,0,GB2312_CHARSET,
// OUT_STROKE_PRECIS,CLIP_STROKE_PRECIS,DRAFT_QUALITY,
// VARIABLE_PITCH|FF_SWISS,_T("黑体"));
pDC->SetMapMode (MM_LOENGLISH);
//===========================
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP);
BITMAP bm;
bmp.GetBitmap(&bm);
CDC dcMem;
dcMem.CreateCompatibleDC(pDC);
CBitmap* pbmpOld=dcMem.SelectObject(&bmp);
pDC->BitBlt(850,-55,bm.bmWidth,bm.bmHeight, &dcMem,0,0,SRCCOPY);
dcMem.SelectObject(pbmpOld);
bmp.GetObject(sizeof(BITMAP),&bm);
//CBitmap bitmap;
//bitmap.LoadBitmap (IDB_BITMAP);
//HDC hdc;
//HBITMAP bitmap;
//hdc = CreateCompatibleDC(NULL);
//bitmap = (HBITMAP)LoadImage(NULL,"E:\\LiuYuLi\\打印\\MyPrinter\\Debug\\database\\1.bmp",IMAGE_BITMAP,640,480,LR_LOADFROMFILE);
//SelectObject(hdc,bitmap);
//BITMAP bm;
// bitmap.GetBitmap(&bm);
//CChildView* pParentWnd=NULL;
//CreateEx(0,
// AfxRegisterWndClass(0, AfxGetApp()->LoadStandardCursor(IDC_ARROW)),
// NULL, WS_POPUP | WS_VISIBLE, 0, 0, bm.bmWidth, bm.bmHeight, pParentWnd->GetSafeHwnd(), NULL);
//=========================================
pDC->SetMapMode (MM_LOENGLISH);
x_start=rc.left+40;//
y_start=rc.top-90;
//x_long=rc.right+35;
x_long=820;
y_long=22*10;
oldfont=pDC->SelectObject(&newfont);
pDC->SetTextAlign (TA_CENTER);
pDC->ExtTextOut(x_start+x_long/2+40,y_start+52,NULL,NULL,"山东省临沂药材采购供应站商品发货单",NULL);
pDC->SelectObject (&pen_thick);
pDC->MoveTo (x_start+280,y_start+25);
pDC->LineTo (x_start+620,y_start+25);//画标题下面的线
pDC->SelectObject(oldfont);//newfont_t
pDC->SetTextAlign (TA_LEFT);
pDC->ExtTextOut(x_start+655,y_start+45,NULL,NULL,"NO."+CMyClass::s_NO_ ,NULL);
pDC->ExtTextOut(x_start+655,y_start+25,NULL,NULL,"仓库:"+CMyClass::s_WareHouse ,NULL);
pDC->ExtTextOut(x_start+55,y_start+45,NULL,NULL,"购货单位:"+CMyClass::s_HospitalName ,NULL);
pDC->ExtTextOut(x_start+55,y_start+25,NULL,NULL,"开票日期:"+CMyClass::s_DateTime ,NULL);
pDC->SelectObject (&pen_thin); //画细线
//int j=0;
for(int j=0;j<11;j++)//画横线
{
pDC->MoveTo ((int)(x_start+50),y_start-j*22+5);
pDC->LineTo ((int)(x_start+820),y_start-j*22+5);
}
//画长竖线
//pDC->MoveTo (50,-100);
//pDC->LineTo (50,-1000);
pDC->MoveTo ((int)(x_start+50),y_start+5);
pDC->LineTo ((int)(x_start+50),y_start+5-y_long);
pDC->MoveTo ((int)(x_start+50+80),y_start+5);
pDC->LineTo ((int)(x_start+50+80),y_start+5-y_long);
pDC->MoveTo ((int)(x_start+50+80+480),y_start+5);
pDC->LineTo ((int)(x_start+50+80+480),y_start+5-y_long);
pDC->MoveTo ((int)(x_start+x_long),y_start+5);
pDC->LineTo ((int)(x_start+x_long),y_start+5-y_long);
//画短竖线
pDC->MoveTo ((int)(x_start+50+220),y_start+5);
pDC->LineTo ((int)(x_start+50+220),y_start+5-y_long+22);
pDC->MoveTo ((int)(x_start+50+340),y_start+5);
pDC->LineTo ((int)(x_start+50+340),y_start+5-y_long+22);
pDC->MoveTo ((int)(x_start+50+400),y_start+5);
pDC->LineTo ((int)(x_start+50+400),y_start+5-y_long+22);
pDC->MoveTo ((int)(x_start+50+480),y_start+5);
pDC->LineTo ((int)(x_start+50+480),y_start+5-y_long+22);
pDC->MoveTo ((int)(x_start+50+660),y_start+5);
pDC->LineTo ((int)(x_start+50+660),y_start+5-y_long+22);
pDC->MoveTo ((int)(x_start+50+735),y_start+5);
pDC->LineTo ((int)(x_start+50+735),y_start+5-y_long+22);
pDC->ExtTextOut ((int)(x_start+x_long*0.077),y_start+2,NULL,NULL,"药品编号",NULL);
pDC->ExtTextOut ((int)(x_start+x_long*0.2),y_start+2,NULL,NULL,"商品名称" ,NULL);
pDC->ExtTextOut ((int)(x_start+x_long*0.36),y_start+2,NULL,NULL,"生产厂家" ,NULL);
pDC->ExtTextOut ((int)(x_start+x_long*0.49),y_start+2,NULL,NULL,"单位" ,NULL);
pDC->ExtTextOut ((int)(x_start+x_long*0.58),y_start+2,NULL,NULL,"数量" ,NULL);
pDC->ExtTextOut ((int)(x_start+x_long*0.67),y_start+2,NULL,NULL,"单价" ,NULL);
pDC->ExtTextOut ((int)(x_start+x_long*0.79),y_start+2,NULL,NULL,"金额" ,NULL);
pDC->ExtTextOut ((int)(x_start+x_long*0.87),y_start+2,NULL,NULL,"商品批号" ,NULL);
pDC->ExtTextOut ((int)(x_start+x_long*0.965),y_start+2,NULL,NULL,"效期" ,NULL);
pDC->ExtTextOut ((int)(x_start+x_long*0.063),y_start-195,NULL,NULL,"总价(大写)" ,NULL);
//pDC->ExtTextOut ((int)(x_start+x_long*0.1),y_start,NULL,NULL,"效期" ,NULL);
pDC->ExtTextOut(x_start+55,y_start-y_long,NULL,NULL,"保管:",NULL);
pDC->ExtTextOut(x_start+255,y_start-y_long,NULL,NULL,"复核:",NULL);
pDC->ExtTextOut(x_start+600,y_start-y_long,NULL,NULL,"制单:Manager",NULL);
if(CMyClass::b_ShowPage ==TRUE)//显示页码
{
strTemp.Format (" %d/%d 页 ",CMyClass::m_curpage,CMyClass::m_maxpage);
pDC->TextOut (x_start+800,y_start-y_long,strTemp);
}
//以下代码显示要打印的药品单据
if(CMyClass::m_Error ==TRUE)
return ;
if(CMyClass::m_MaxCounts ==0)
return ;
if(head==NULL)
return ;
p=head;
//将指针移到打印页的第一条记录上
if(CMyClass::m_curpage !=1)
{
for(int a_l=1;a_l<=(CMyClass::m_curpage -1)*8;a_l++)
{
p=p->next;
}
}
if(CMyClass::m_curpage<=CMyClass::m_maxpage)//CMyclass::m_curpage<CMyclass::m_maxpage
{
//pDC->SelectObject (&newfont_t);
pDC->SetTextAlign (TA_LEFT);
for(int j=1;j<=8;++j)
{
//int x=0,y=0;
i=(CMyClass::m_curpage -1)*8+j;
if(i>CMyClass::m_MaxCounts )
{
break;
}
if(p==NULL)
{
this->MessageBox ("1");
break ;
}
//x=
//y=y_start-55-(j-1)*25;
//pDC->ExtTextOut (x_start,y,NULL,NULL,p->sGoodsNum,NULL);
//pDC->ExtTextOut ((int)(x_start+x_long*0.1),y,NULL,NULL,p->sGoodsName ,NULL);
//pDC->ExtTextOut ((int)(x_start+x_long*0.25),y,NULL,NULL,p->sSpecs ,NULL);
//pDC->ExtTextOut ((int)(x_start+x_long*0.35),y,NULL,NULL,p->sUnit ,NULL);
i=3-22*j;
pDC->ExtTextOut ((int)(x_start+x_long*0.08),y_start+i,NULL,NULL,p->s_SerialNum ,NULL);//药品编号
pDC->ExtTextOut ((int)(x_start+x_long*0.17),y_start+i,NULL,NULL,p->s_Name ,NULL);//商品名称
pDC->ExtTextOut ((int)(x_start+x_long*0.35),y_start+i,NULL,NULL,p->s_Plant ,NULL);//生产厂家
pDC->ExtTextOut ((int)(x_start+x_long*0.5),y_start+i,NULL,NULL,p->s_Unit ,NULL);//单位
pDC->ExtTextOut ((int)(x_start+x_long*0.57),y_start+i,NULL,NULL,p->s_Num ,NULL);//数量
pDC->ExtTextOut ((int)(x_start+x_long*0.65),y_start+i,NULL,NULL,p->s_Price ,NULL);//单价
pDC->SetTextAlign (TA_RIGHT);
pDC->ExtTextOut ((int)(x_start+x_long*0.86),y_start+i,NULL,NULL,p->s_TotalNum ,NULL);//金额
pDC->SetTextAlign (TA_LEFT);
pDC->ExtTextOut ((int)(x_start+x_long*0.885),y_start+i,NULL,NULL,p->s_PiHao ,NULL);//商品批号
pDC->ExtTextOut ((int)(x_start+x_long*0.965),y_start+i,NULL,NULL,p->s_Year ,NULL);//效期
double_money+=atof(p->s_TotalNum );
p=p->next ;
}//end for
}//END IF
strMoneyAmount.Format ("¥%.2f",double_money);
pDC->SetTextAlign (TA_RIGHT);
pDC->ExtTextOut ((int)(x_start+x_long*0.86),y_start+3-22*9,NULL,NULL,strMoneyAmount ,NULL);//总金额
pDC->SetTextAlign (TA_LEFT);
strMoneyAmount="";
this->Convert (double_money,&strMoneyAmount);
pDC->ExtTextOut ((int)(x_start+x_long*0.165),y_start+3-22*9,NULL,NULL,strMoneyAmount ,NULL);//总金额大写
// pDC->SetTextAlign (TA_LEFT);
//----------------------------- 结束 ------------------------------------
}
void CChildView::OnFilePrint()
{
CView::OnFilePrint();
}
BOOL CChildView::OnPreparePrinting(CPrintInfo* pInfo)
{
// TODO: call DoPreparePrinting to invoke the Print dialog box
// CAttendanceApp* app=(CAttendanceApp*)AfxGetApp();//岚增
// app->OnFilePrintSetup();
////////////自己的代码 开始////////////////////////////////////////////////////////////////////
PRINTDLG pd; //该结构包含打印对话框中的所有信息
AfxGetApp()->GetPrinterDeviceDefaults(&pd);
LPTSTR lpDeviceName,lpPrinterName,lpPortName;
LPDEVMODE pDevMode = (LPDEVMODE)::GlobalLock(pd.hDevMode);
LPDEVNAMES pDevName = (LPDEVNAMES)::GlobalLock(pd.hDevNames);
//char *pPrinterName = (char *)pDevName + pDevName->wDeviceOffset;
if(!pDevMode)
{
CWnd::MessageBox ("没有安装打印机驱动程序或者没有设置默认打印机!","打印机处错",MB_ICONHAND|MB_ICONSTOP|MB_ICONERROR);
return FALSE;
}
lpDeviceName=(LPTSTR)pDevName+pDevName->wDriverOffset ;
lpPrinterName=(LPTSTR)pDevName+pDevName->wDeviceOffset ;
lpPortName=(LPTSTR)pDevName+pDevName->wOutputOffset ;
PRINTER_DEFAULTS pDefault;
HANDLE hPrinter; // pointer to printer or server handle
ZeroMemory(&pDefault,sizeof(PRINTER_DEFAULTS));
//pDefault->pDatatype=NULL;
//pDefault->pDevMode=0;
pDefault.DesiredAccess=PRINTER_ALL_ACCESS;
OpenPrinter(lpPrinterName,&hPrinter,&pDefault);// &pDefault"HP LaserJet 6L Pro (PCL)" pPrinterName pDefault
FORM_INFO_1 form_1;
form_1.Flags=FORM_USER;
form_1.pName="UserPaper";
form_1.Size.cx =2410;//2160
form_1.Size .cy =993;//14000
form_1.ImageableArea.top =0;
form_1.ImageableArea.bottom=14000;
form_1.ImageableArea.left =0;
form_1.ImageableArea.right =21600;
DeleteForm(hPrinter,"UserPaper");
LPBYTE pForm;
pForm=(PBYTE)&form_1;
AddForm(hPrinter,1,pForm); // Pointer to a FORM_INFO_1 structure.
CDC *pDC;
pDC=GetDC();
CPrintDialog m_PrintDlg(FALSE);
HDC m_hDC;
m_hDC=m_PrintDlg.CreatePrinterDC ();
LPDEVMODE lpDevMode;
if(AfxGetApp()->GetPrinterDeviceDefaults(&pd )) //获得默认的打印机的信息
{
lpDevMode=(LPDEVMODE)GlobalLock(pd.hDevMode);
if(lpDevMode)
{
lpDevMode->dmFields |= DM_ORIENTATION ; //0x00000001L;
lpDevMode->dmFields |=DM_PAPERSIZE; // 0x00000002L;
lpDevMode->dmFields |=DM_PAPERLENGTH ; //0x00000007L;
lpDevMode->dmFields |= DM_PAPERWIDTH ;
lpDevMode->dmFields |= DM_FORMNAME;//DM_FORMNAME
lpDevMode->dmPaperSize=DMPAPER_USER; //将打印纸设置为A4 DMPAPER_A4
strcpy((LPSTR)pDevMode->dmFormName ,"UserPaper");
lpDevMode->dmOrientation=1; //将打印机设置为横向打印。DMORIENT_LANDSCAPE==1
lpDevMode->dmPaperWidth =2410;//单位0.1mm
lpDevMode->dmPaperLength =933;//单位0.1mm
/*
if(CMyclass::m_PrintItem ==60||CMyclass::m_PrintItem ==90)
{
lpDevMode->dmPaperSize=DMPAPER_A4; //将打印纸设置为A4 DMPAPER_A4
lpDevMode->dmOrientation=2; //将打印机设置为横向打印。DMORIENT_LANDSCAPE
}
if(CMyclass::m_PrintItem ==70||CMyclass::m_PrintItem ==80)
{
lpDevMode->dmPaperSize=DMPAPER_A4; //将打印纸设置为A4 DMPAPER_A4
lpDevMode->dmOrientation=1; //将打印机设置为横向打印。DMORIENT_LANDSCAPE
}
if(CMyclass::m_PrintItem ==50)
{
lpDevMode->dmPaperWidth =3560;//单位0.1mm 216*140mm和356*279mm
lpDevMode->dmPaperLength =2790;//单位0.1mm
}
if(CMyclass::m_PrintItem ==40||CMyclass::m_PrintItem ==45)
{
lpDevMode->dmPaperWidth =2100;//单位0.1mm
lpDevMode->dmPaperLength =2790;//单位0.1mm
}
if(CMyclass::m_PrintItem <=30)
{
lpDevMode->dmPaperWidth =2160;//单位0.1mm 216*140mm和356*279mm
lpDevMode->dmPaperLength =1400;//单位0.1mm
}
if(CMyclass::m_PrintItem ==20||CMyclass::m_PrintItem ==21)
{
lpDevMode->dmPaperWidth =2160;//单位0.1mm 216*140mm和356*279mm
lpDevMode->dmPaperLength =1400;//单位0.1mm
}
if(CMyclass::m_PrintItem ==25||CMyclass::m_PrintItem ==26)
{
lpDevMode->dmPaperWidth =2160;//单位0.1mm 216*140mm和356*279mm
lpDevMode->dmPaperLength =1400;//单位0.1mm
}
if(CMyclass::m_PrintItem ==10||CMyclass::m_PrintItem ==11)
{
lpDevMode->dmPaperWidth =2160;//单位0.1mm 216*140mm和356*279mm
lpDevMode->dmPaperLength =1400;//单位0.1mm
}
if(CMyclass::m_PrintItem ==15||CMyclass::m_PrintItem ==16)
{
lpDevMode->dmPaperWidth =2160;//单位0.1mm 216*140mm和356*279mm
lpDevMode->dmPaperLength =1400;//单位0.1mm
}
*/
pDC->ResetDC(lpDevMode);
//lpDevMode->dmPrintQuality=600; //打印分辨率为600dpi
}
GlobalUnlock(pd.hDevMode);
ClosePrinter(hPrinter);
}
if(CMyClass::b_BeingPrinting==FALSE)
{
CMyClass::b_BeingPrinting=TRUE;
}
////////////自己的代码 结束////////////////////////////////////////////////////////////////////
return CWrapperView::OnPreparePrinting(pInfo);
}
void CChildView::OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo)
{
// TODO: Add your specialized code here and/or call the base class
//从数据库中取出数据,并将数据放到链表中
//------------开始
p=NULL;
pEnd=NULL;
head=NULL;
//pEnd->next =NULL;
//读表里的数据并分解
try//读取当前数据
{
//if((m_recordset->adoEOF==VARIANT_TRUE)&&(m_recordset->BOF==VARIANT_TRUE))
if((p_recordset->adoEOF)&&(p_recordset->BOF))
{
CWnd::MessageBox ("数据库中没有记录!");
return;
}
//long iii=p_recordset->GetRecordCount ();
if(!p_recordset->BOF) p_recordset->MoveFirst ();
CMyClass::m_MaxCounts =0;
//while(p_recordset->adoEOF==VARIANT_FALSE)
while(!p_recordset->adoEOF)
{
//str_temp=(char *)(_bstr_t)(p_recordset->Fields ->GetItem(_variant_t("货单编号"))->Value);
//if(str_temp!=CMyClass::s_IndentureNum )
//{
// p_recordset->MoveNext ();
// continue;
//}
p=new PrintDB;
CMyClass::m_MaxCounts ++;
if(head==NULL) { head=p; pEnd=p; }
else { pEnd->next =p; }
pEnd=p;
pEnd->next =NULL;
if(p_recordset->Fields ->GetItem(_variant_t("药品编号"))->Value.vt ==VT_NULL)
p->s_SerialNum ="";
else
p->s_SerialNum =(char *)(_bstr_t)(p_recordset->Fields ->GetItem
(_variant_t("药品编号"))->Value);
if(p_recordset->Fields ->GetItem(_variant_t("商品名称"))->Value.vt ==VT_NULL)
p->s_Name ="";
else
p->s_Name=(char *)(_bstr_t)(p_recordset->Fields ->GetItem
(_variant_t("商品名称"))->Value);
if(p_recordset->Fields ->GetItem(_variant_t("生产厂家"))->Value.vt ==VT_NULL)
p->s_Plant ="";
else
p->s_Plant=(char *)(_bstr_t)(p_recordset->Fields ->GetItem
(_variant_t("生产厂家"))->Value);
if(p_recordset->Fields ->GetItem(_variant_t("单位"))->Value.vt ==VT_NULL)
p->s_Unit ="";
else
p->s_Unit=(char *)(_bstr_t)(p_recordset->Fields ->GetItem
(_variant_t("单位"))->Value);
if(p_recordset->Fields ->GetItem(_variant_t("数量"))->Value.vt ==VT_NULL)
p->s_Num ="";
else
p->s_Num=(char *)(_bstr_t)(p_recordset->Fields ->GetItem
(_variant_t("数量"))->Value);
if(p_recordset->Fields ->GetItem(_variant_t("单价"))->Value.vt ==VT_NULL)
p->s_Price ="";
else
p->s_Price=(char *)(_bstr_t)(p_recordset->Fields ->GetItem
(_variant_t("单价"))->Value);
if(p_recordset->Fields ->GetItem(_variant_t("金额"))->Value.vt ==VT_NULL)
p->s_TotalNum ="";
else
p->s_TotalNum=(char *)(_bstr_t)(p_recordset->Fields ->GetItem
(_variant_t("金额"))->Value);
if(p_recordset->Fields ->GetItem(_variant_t("商品批号"))->Value.vt ==VT_NULL)
p->s_PiHao ="";
else
p->s_PiHao=(char *)(_bstr_t)(p_recordset->Fields ->GetItem
(_variant_t("商品批号"))->Value);
if(p_recordset->Fields ->GetItem(_variant_t("有效期"))->Value.vt ==VT_NULL)
p->s_Year ="";
else
p->s_Year=(char *)(_bstr_t)(p_recordset->Fields ->GetItem
(_variant_t("有效期"))->Value);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -