[Gdal-dev] Another problem with MapInfo driver?
richard at waypointinfo.com
Wed Mar 29 11:35:22 EST 2006
Visual Studio .NET 2005 doesn't like what is happening with the OGR MapInfo
driver. In debug mode, the first time that I try to create a datasource it
always fails. Sometimes, if I try again immediately (i.e. in the catch()) it
will succeed. The exception message is:
Message="Attempted to read or write protected memory. This is often an
indication that other memory is corrupt."
hDriver, String pszName, String& papszOptions)
at GDALWrapper.OGR.OgrDriver.CreateDataSource(String folderName,
List`1 options) in
If I compile the OGR C# wrapper project in Release mode, it works more
consistently, but still always fails the first time.
This does not happen with CSV, ESRI drivers in debug or release.
Running the executable outside the IDE works fine as well.
My test code is very simple. Any thoughts or suggestions are welcome.
public class OgrTest
//private string driverName = "CSV";
//private string driverName = "ESRI Shapefile";
private string driverName = "MapInfo File";
private List<string> driverOptions = new List<string>();
private string folderName = @"D:\temp\simpletest";
public void Test()
OgrDriver driver = OgrDriver.GetDriverByName(driverName);
if (driver == null)
throw new ArgumentOutOfRangeException(driverName + " driver not
OgrDataSource dataSource = driver.CreateDataSource(folderName,
if (dataSource == null)
throw new ArgumentException("Output folder creation failed.");
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Gdal-dev