锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
Cdrecord-Clone 2.01-dvd (i686-pc-linux-gnu) Copyright (C) 1995-2004 J鏋歳g Schilling
Note: This version is an unofficial (modified) version with DVD support
Note: and therefore may have bugs that are not present in the original.
Note: Please send bug reports or support requests to http://bugzilla.redhat.com/bugzilla
Note: The author of cdrecord should not be bothered with problems in this version.
scsidev: 'ATA'
devname: 'ATA'
scsibus: -2 target: -2 lun: -2
Linux sg driver version: 3.5.27
Using libscg version 'schily-0.8'.
cdrecord: Warning: using inofficial libscg transport code version (schily - Red Hat-scsi-linux-sg.c-1.83-RH '@(#)scsi-linux-sg.c聽聽聽聽 1.83 04/05/20 Copyright 1997 J. Schilling').
scsibus1:
聽聽聽聽聽聽聽 1,0,0聽聽 100) 'HL-DT-ST' 'CD-RW GCE-8400B ' '1.02' Removable CD-ROM
聽聽聽聽聽聽聽 1,1,0聽聽 101) *
聽聽聽聽聽聽聽 1,2,0聽聽 102) *
聽聽聽聽聽聽聽 1,3,0聽聽 103) *
聽聽聽聽聽聽聽 1,4,0聽聽 104) *
聽聽聽聽聽聽聽 1,5,0聽聽 105) *
聽聽聽聽聽聽聽 1,6,0聽聽 106) *
聽聽聽聽聽聽聽 1,7,0聽聽 107) *
[root@linux-test188 ~]# cdrecord -v speed=8 dev=1,0,0 test.iso
[root@linux-test188 ~]# mkisofs -r -o cd.iso -m temp ./tempfiles
聽// Generated message map functions
聽//{{AFX_MSG(Input)
聽afx_msg BOOL OnEraseBkgnd(CDC* pDC);
聽afx_msg void OnButtonOk();
聽afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
聽afx_msg void OnPaint();
聽//}}AFX_MSG
聽DECLARE_MESSAGE_MAP()
澹版槑娑堟伅寰幆:
BEGIN_MESSAGE_MAP(Input, CDialog)
聽//{{AFX_MSG_MAP(Input)
聽ON_BN_CLICKED(IDC_BUTTON_OK, OnButtonOk)
聽ON_WM_LBUTTONDBLCLK()
聽ON_WM_PAINT()
聽ON_WM_ERASEBKGND()
聽//}}AFX_MSG_MAP
END_MESSAGE_MAP()
瀹炵幇錛?br />BOOL Input::OnEraseBkgnd(CDC* pDC)
{
聽if(m_hBmp)
聽{
聽聽BITMAP bm;
聽聽GetObject(m_hBmp,sizeof(bm),&bm);
聽聽HDC hMemdc=CreateCompatibleDC(pDC->m_hDC);
聽聽if(hMemdc)
聽聽{
聽聽聽聽 HBITMAP hOldBmp=(HBITMAP)SelectObject(hMemdc,m_hBmp);
聽聽聽聽 if(hOldBmp)
聽聽聽聽 {
聽聽聽聽聽 BitBlt(pDC->m_hDC,0,0,bm.bmWidth,bm.bmHeight,hMemdc,0,0,SRCCOPY);
聽聽聽聽聽 SelectObject(hMemdc,hOldBmp);
聽聽聽聽聽 DeleteDC(hMemdc);
聽聽聽聽聽 DeleteObject(hOldBmp);
聽聽聽聽聽 return TRUE;
聽聽聽聽 }
聽聽聽聽 else
聽聽聽 DeleteDC(hMemdc);
聽聽}
聽}
聽return CDialog::OnEraseBkgnd(pDC);
}
snprintf(_snprintf)鐨勫0鏄庢槸榪欐牱鐨?/p>
int _snprintf(
聽聽 char *buffer,
聽聽 size_t count,
聽聽 const char *format [,
聽聽聽聽聽 argument] ...
);
If len < count, then len characters are stored in buffer, a null-terminator is appended, and len is returned.
If len = count, then len characters are stored in buffer, no null-terminator is appended, and len is returned.
If len > count, then count characters are stored in buffer, no null-terminator is appended, and a negative value is returned.
鏈甯歌鐨勯敊璇敤娉曟湁:
1.
char sa[256]={0};
_snprintf(sa,sizeof(sa),"%s",sb);
//閿欒鍘熷洜:褰搒b鐨勯暱搴?gt;=256鐨勬椂鍊?sa灝嗘病鏈?\0'緇撳熬
2.
char sa[256];
_snprintf(sa,sizeof(sa)-1,"%s",sb);
//閿欒鍘熷洜:褰搒b鐨勯暱搴?gt;=255鐨勬椂鍊?sa灝嗘病鏈?\0'緇撳熬,蹇樿緇檚a鍒濆鍖?/p>
3.
char sa[256];
_snprintf(sa,sizeof(sa)-1,"%s",sb);
sa[sizeof(sa)]=0;
//閿欒鍘熷洜:鏈鍚庝竴琛屾暟緇勮秺鐣?/p>
姝g‘鐨勭敤娉?br />1. //鎺ㄨ崘鐢ㄦ硶
char sa[256];
sa[sizeof(sa)-1]=0;
_snprintf(sa,sizeof(sa),"%s",sb);
if(sa[sizeof(sa)-1]!=0)
{
聽聽 printf("warning:string will be truncated");
聽聽 sa[sizeof(sa)-1]=0;
}
2.
char sa[256]={0};
int result = _snprintf(sa,sizeof(sa),"%s",sb);
if(result==sizeof(sa) || result<0)
{
聽聽聽 printf("warning:sting will be truncated");
聽聽 sa[sizeof(sa)-1]=0;
}
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
褰撶劧鏈鍚庤繕瑕佸畬鎴愬嚱鏁板疄浣?/p>