dLSoft

Quick_links...

Search site
Trial products
Online tutorials

Products

Barcodes for Office
Barcode creators
Barcode fonts
Developer tools
Label printing
Labelling tools
Point Of Sale

Resources

New to barcodes?
How To ...
Support centre
Tutorial centre
Which product

For users

Common problems
What's New?
Newsletter
Online registration
Contact us

GS1

Award 2009

Award 2008

 

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);
}