[Gdal-dev] GDAL, ECW, and COM

Peng Gao pgao at esri.com
Fri Apr 1 17:10:08 EST 2005


I wrote a new GDAL dataset whose implementation uses some COM objects.
When I do a CreateCopy() using my dataset as input, it works for most
formats except ECW. The error is that COM objects can not be cocreated
because CoInitialize() is not called on the thread. The following is
the call stack (Windows) when the error occurred. It looks like a
different thread from the main thread where GDALDriver::CreateCopy() is
invoked.

If this is true, can the compressor thread be enclosed in CoInitialize()
and CoUninitialize()?

Thanks
Gao, Peng


	GdalRasterDB.dll!ESRIRasterDataset::Read(long ix=0, long iy=0, long
nx=6614, long ny=256, IPixelBlock * * ppPixelBlock=0x0527bc18)  Line 93 +
0x11	C++
 	GdalRasterDB.dll!ESRIRasterBand::IReadBlock(int nBlockXOff=0, int
nBlockYOff=0, void * pImage=0x05380020)  Line 182	C++
 	gdal12.dll!GDALRasterBand::GetBlockRef(int nXBlockOff=0, int
nYBlockOff=0, int bJustInitialize=0)  Line 1149 + 0x22	C++
 	gdal12.dll!GDALRasterBand::IRasterIO(GDALRWFlag eRWFlag=GF_Read, int
nXOff=0, int nYOff=0, int nXSize=6614, int nYSize=1, void *
pData=0x05280048, int nBufXSize=6614, int nBufYSize=1, GDALDataType
eBufType=GDT_Byte, int nPixelSpace=1, int nLineSpace=6614)  Line 175 + 0x12
C++
 	gdal12.dll!GDALDataset::IRasterIO(GDALRWFlag eRWFlag=GF_Read, int
nXOff=0, int nYOff=0, int nXSize=6614, int nYSize=1, void *
pData=0x05280048, int nBufXSize=6614, int nBufYSize=1, GDALDataType
eBufType=GDT_Byte, int nBandCount=3, int * panBandMap=0x0324bde0, int
nPixelSpace=1, int nLineSpace=6614, int nBandSpace=6614)  Line 1292 + 0x37
C++
 	gdal12.dll!GDALDataset::RasterIO(GDALRWFlag eRWFlag=GF_Read, int
nXOff=0, int nYOff=0, int nXSize=6614, int nYSize=1, void *
pData=0x05280048, int nBufXSize=6614, int nBufYSize=1, GDALDataType
eBufType=GDT_Byte, int nBandCount=3, int * panBandMap=0x0324bde0, int
nPixelSpace=1, int nLineSpace=6614, int nBandSpace=6614)  Line 1485 + 0x43
C++
 	gdal12.dll!GDALECWCompressor::WriteReadLine(unsigned int
nNextLine=0, void * * ppInputArray=0x0230bba8)  Line 190 + 0x5f	C++
 	NCSEcw.dll!5ff24600() 	
 	NCSUtil.dll!5feaa9d9() 	



More information about the Gdal-dev mailing list