[Gdal-dev] Registering a format driver at run-time

Peng Gao pgao at esri.com
Mon Feb 13 15:27:09 EST 2006


I am trying to figure out a way I can load/register a GDAL driver at
run-time.
The way I go about it is as the following, for ECW for example:

1) Build/link GDAL13 without ECW;
2) Build/link ECW driver, ECW and GDAL import libraries, NCS*.lib, and
gdal_i.lib into a 
   separate dll, grf_ecw.dll;
3) Build/link my app with gdal_i.lib;
4) Load grf_ecw.dll at run-time using LoadLibrary, find register_ECW
symbol address, and call
   the function to register ECW with GDAL;

Are there any issues, technical and otherwise, at all to do this? 

My prototype mostly works, except I keep hitting unhandled exceptions
"Unhandled exception at 0x7c901230 in myapp.exe: User breakpoint" 
whenever a GDAL dataset is released. Can anyone help?

I am using VC++7 and Windows XP.


ntdll.dll!7c901230() 	
 	ntdll.dll!7c96c943() 	
 	ntdll.dll!7c96cd80() 	
 	ntdll.dll!7c96df66() 	
 	ntdll.dll!7c96e0d4() 	
 	ntdll.dll!7c926abe() 	
 	ntdll.dll!7c94a5d0() 	
 	ntdll.dll!7c9268ad() 	
 	ntdll.dll!7c926abe() 	
 	ntdll.dll!7c9268ad() 	
 	ntdll.dll!7c91056d() 	
 	ntdll.dll!7c911962() 	
 	ntdll.dll!7c926abe() 	
 	ntdll.dll!7c9268ad() 	
 	ntdll.dll!7c91056d() 	
 	ntdll.dll!7c9268ad() 	
>	NCSUtil.dll!NCSMutexEnd(NCSMutex * pMutex=0x7c911962)  Line 271
C
 	ntdll.dll!7c91056d() 	
 	ntdll.dll!7c911993() 	
 	ntdll.dll!7c911970() 	
 	ntdll.dll!7c91056d() 	
 	msvcr71.dll!02c4218a() 	
 	msvcr71.dll!02c4218f() 	
 	msvcr71.dll!02c4218a() 	
 	NCSEcw.dll!CNCSFile::`vector deleting destructor'()  + 0x4d
C++
 	grf_ecw.dll!ECWDataset::~ECWDataset()  Line 685 + 0x38	C++
 	grf_ecw.dll!ECWDataset::`vector deleting destructor'()  + 0x6c
C++
 	gdal13.dll!GDALClose(void * hDS=0x08a26ea8)  Line 1824 + 0x1e
C++
 	GdalRasterDB.dll!GdlRasterDataset::Close()  Line 2040	C++
 	GdalRasterDB.dll!GdlRasterDataset::~GdlRasterDataset()  Line 80
C++
 	GdalRasterDB.dll!GdlRasterDataset::`scalar deleting
destructor'()  + 0x16	C++
 	GdalRasterDB.dll!Unknown::InternalRelease()  Line 395 + 0x1f	
 	GdalRasterDB.dll!GdlRasterDataset::Release()  Line 32 + 0x28
C++




More information about the Gdal-dev mailing list