Sample C++ source code for dBarcode DLL

Code draws a barcode image in a device context, using the barcode data in pDoc->data. For the BarCdh2() calls other barcode parameters have already been set in memory.

void CVc32demoView::OnDraw(CDC* pDC)
{
CVc32demoDoc* pDoc = GetDocument();
RECT CliRect,ttRect;
int i,n;
SIZE sz;
POINT pt;
RECT tRect;

iwid=3000; // target size in 0.01 mm
iht=2000; // target size in 0.01 mm
SetRect(&tRect,0,0,iwid,iht);
sz.cx=iwid;
sz.cy=iht;
if (pDC->IsPrinting()) {
pt.x=600; // this sample does not include the logic for PrintPreview
pt.y=600;
}
else {
pt.x=20;
pt.y=60;
}
n=1;
i=BarCdh2(pDC->m_hDC,(LPSTR)pDoc->data, (LPPOINT)&pt,(LPSIZE)&sz,n);
}

 


Sites operated by DL Technology Ltd                            barcode software       barcode fonts                  
E-mail: webmaster@dlsoft.com                      [Product index] [Site index
05/11/2008

dLSoft is a registered trade mark of DL Technology Ltd, a company registered in England number 3615271

Award-winning publisher 2006    dLSoft - Award-winning publisher 2006 & 2007     Award-winning publisher 2007