MapWindow 4 - ActiveX Control Programming : MapWindow Discussion Forum
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
Opening grid causes a crash
Posted by: sindizzy ()
Date: May 04, 2012 03:40PM

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

Options: ReplyQuote


Sorry, only registered users may post in this forum.





Banner Exchange




GISCP.com




Send us your banner logo (160x120) for the space above, and add this MapWindow banner ad to your site:

Just paste this text in your page: