LoadArray example for C++ 5.0 and later
long lCount;
HFILE hFile;
HGLOBAL hData=NULL;
void FAR* pData=NULL;
ILEADRasterIO *pRasterIO=NULL;
ILEADRasterVariant * pltRasVar = NULL;
CoCreateInstance(CLSID_LEADRasterVariant, NULL, CLSCTX_ALL,
IID_ILEADRasterVariant, (void **)&pltRasVar);
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL,
IID_ILEADRasterIO, (void**)&pRasterIO);
hFile = _lopen("v:\\images\\babe.cmp", OF_READ);
lCount = _llseek(hFile, 0, SEEK_END);
_llseek(hFile, 0, SEEK_SET);
hData = GlobalAlloc(GMEM_MOVEABLE, lCount);
pData = GlobalLock(hData);
_lread(hFile, pData, lCount);
pltRasVar->Type = VALUE_ARRAY_BYTE;
pltRasVar->ItemCount = lCount;
for(long i=0; i<lCount; i++)
pltRasVar->ShortItemValue(i) = (short)pData[i];
GlobalUnlock(hData);
GlobalFree(hData);
pRasterIO->LoadArray(m_LEADRasterView1.GetRaster(),
pltRasVar, 0, 0, -1, lCount);
pRasterIO->Release();
pltRasVar->Release();
_lclose(hFile);