MapWindow / MapWinGIS

MapWinGIS.ocx is a FREE and OPEN SOURCE C++ based geographic information system programming ActiveX Control and application programmer interface (API) that can be added to a Windows Form in Visual Basic, C#, Delphi, or other languages that support ActiveX, providing your app with a map. Go to our forum for questions and help:
https://mapwindow.discourse.group/
Mozilla Public License 2.0
270 stars 134 forks source link

5.0.1 not working 100% with VB6 #155

Closed BrendanM-RSA closed 4 years ago

BrendanM-RSA commented 5 years ago

I have been using MapWinGIS for a number of years with Vb6. Decided to upgrade to 5.0.1. On one of my more simpler projects the new MapWinGIS seesm to work but nit 100%.

There are some issues

To Reproduce Create a VB6 project, blank form with Map1 on it. Form code as below:

Private sf1 As New MapWinGIS.Shapefile Private Sub Form_Load() ' sf1 does not show any properties in the VB6 IDE Call sf1.CreateNewWithShapeID("", SHP_POLYGON) Call Map1.AddLayer(sf1, True)

' this crashes 'Map1.Extents = sf1.Extents End Sub

Issues

Desktop (please complete the following information):

jerryfaust commented 5 years ago

Hello @BrendanM-RSA

I'm sorry but I'm not able to reproduce this, coded exactly as you have.

Here's a screen shot after stepping past the Map1.Extents setting. I'm able to query both the Shapefile extents and the Map extents (don't ask me why they differ - may have something to do with a buffer).

So at the moment, I'm not sure what to think. Can you try some other operations? Maybe we can get more clues.

image

BrendanM-RSA commented 5 years ago

Runing VB6 SP6

Map was added to toolbox and then to the form as you said.

sf1 no properties - at your breakpoint at End Sub if you add a Watch to sf1 - then I get no properties listed. As per my original screen grab

Only thing that I can think of is that this PC had the old MapWinGIS on it. I initially ran the 5.0.1 installer on top of it. When I saw the errors I uninstalled 5.0.1 (which cleared c:\dev) and manually cleaned the registry of all MapWinGIS entries. Then re-installed 5.0.1

The map1 object onb my form is shwoing its verison as 5.0.1 so I am happy it has found the OCX

Here is my VB6 project Proj.zip

BrendanM-RSA commented 5 years ago

Re-open

frank2x460 commented 5 years ago

Same or similar Problem here, after update from 4.9.3 but different errormessage: grafik De-/installation and cleaning registry with no success. What to do further.

VB6 SP6 Windows 10 PRO (1703)

frank2x460 commented 5 years ago

Sorry, the "SET" Instruction was wrong, now same errormessage: grafik No problems with 4.9.5!

BrendanM-RSA commented 5 years ago

If you have a MapWinGIS ShapeFile in VB6 can you see the runtime properties of it when you create a Watch for it in the IDE?

frank2x460 commented 5 years ago

The extents object shows no properties (xmin,ymin,.....) when creating a watch!

BrendanM-RSA commented 5 years ago

Without doing a test we can probably surmise that in the VB6 runtime IDE no object properties can be viewed in the Watch window

jerryfaust commented 5 years ago

Hello @BrendanM-RSA , @frank2x460 ,

I'm not sure what's going on. We have an older app that first moved to MapWinGIS at 4.9.x. I've recently updated to 5.0.1, still with no problem. Here's a screenshot just after assigning the Extents. It does appear that the Watch window, at least the the Extents, is worthless. At any rate, we'll have to try to figure out what's different... One thing that comes to mind is that I build MapWinGIS on this machine from the source code (I didn't run the installer). The COM registration should be identical. I'll see if I can find a machine that has VB6 that I can run the installer on, to see if that makes the difference... image

Regards, Jerry.

pmeems commented 4 years ago

If this is still an issue with the latest release (https://github.com/MapWindow/MapWinGIS/releases) could you create a new issue? For now, I close this old issue.