Absolutepos Example for Visual C++ 5.0
// This Sample returns the bounding rect that specifies the absolute position of the cell.
void Absolutepos(CLEADRasterContainerViewer * pLEADContainerViewer, LPRECT rcRect)
{
POINT pt;
char * MedicalKey = "";
pLEADContainerViewer->SetEnableMethodErrors (TRUE);
ILEADRaster* pRaster = NULL;
CoCreateInstance(CLSID_LEADRaster, NULL, CLSCTX_ALL, IID_ILEADRaster, (void**)&pRaster);
pRaster->UnlockSupport (L_SUPPORT_MEDICAL, TEXT(MedicalKey));
ILEADRasterIO* pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
//Load IMAGE3.dic from LEAD Technologies setup directory
pRasterIO->Load (pRaster, "C:\\LEAD Technologies, Inc\\LEADTOOLS14\\Images\\IMAGE3.dic", 0, 0, -1);
// Insert a new cell at the end of the container cell queue.
long iCellIndex = pLEADContainerViewer->InsertCell (-1, 0);
// Attach the loaded raster to the newly inserted cell.
pLEADContainerViewer->Cell (iCellIndex).InsertBitmapList (pRaster, TRUE, 0);
// Get the cells bounding rectangle, the corrdinates are relative to the upper
// left corner of the container window.
pLEADContainerViewer->SetScaleMode (SCALEMODE_PIXEL);
pt.x = (int)pLEADContainerViewer->Cell(iCellIndex).GetLeft();
pt.y = (int)pLEADContainerViewer->Cell(iCellIndex).GetTop();
CWnd cContainerWindow;
cContainerWindow.m_hWnd = (HWND)pLEADContainerViewer->GetWindow();
cContainerWindow.ClientToScreen(&pt);
// Get the window handle of the cell
CWnd cCellWindow;
cCellWindow.m_hWnd = (HWND)pLEADContainerViewer->Cell(iCellIndex).GetWindow();
rcRect->left = pt.x;
rcRect->top = pt.y;
rcRect->right = pt.x + (int)pLEADContainerViewer->Cell(iCellIndex).GetWidth();
rcRect->bottom = pt.y + (int) pLEADContainerViewer->Cell (iCellIndex).GetHeight();
OffsetRect(rcRect, pt.x, pt.y);
pRasterIO->Release();
pRaster->Release();
cContainerWindow.m_hWnd = NULL;
cCellWindow.m_hWnd = NULL;
}