This project is read-only.

Opening grid causes a crash

May 4, 2012 at 10:41 PM
Edited May 4, 2012 at 10:41 PM

At MW4.8 it seems something has changed from MW4.7 that processes grids. I try to load ny grid and it caauses a crash both in the MW application and in code.

I try to load it like so

        Dim grdName As String = "C:\Rasters\FTW\FTWMTHW.aux"
        If My.Computer.FileSystem.FileExists(grdName) = True Then
            If grid.Open(grdName, MapWinGIS.GridDataType.LongDataType, True, MapWinGIS.GridFileType.UseExtension) = True Then
                'add to the map
            End If
        End If


This casues a crash in the VB2010 IDE. The IDE exception is "Attempted to read or write protected memory. This is often an indication that other memory is corrupt". Not sure what that is all about as I can load this grid in ArcGIS no problem. The same problem was discussed here [www.mapwindow.org].

I did experiment with this and changed my code to load the sta.adf file and now it seems to work

        Dim grdName As String = "C:\Rasters\FTW\ftwmthw\sta.adf"
        If My.Computer.FileSystem.FileExists(grdName) = True Then
            If grid.Open(grdName, MapWinGIS.GridDataType.LongDataType, True, MapWinGIS.GridFileType.UseExtension) = True Then
                'add to the map
            End If
        End If


Im baffled as to why the AUX file craps out, yet the sta.adf file loads fine. Is there a standard as to what file should be loaded? Is there any difference?

AGP