MapWindow 4 - ActiveX Control Programming : MapWindow Discussion Forum
Hello I didn't get any answer on the new forum so trying on the old good forum for MWG. I have to update my old MapWingis project embedded into an Access Interface written in VBA. I need to have a color scheme for my point shapefile to show differents activities (activ
Library not registered & ShapefileColorScheme
Posted by: springrider ()
Date: May 17, 2012 11:13PM

Hello

I didn't get any answer on the new forum so trying on the old good forum for MWG.

I have to update my old MapWingis project embedded into an Access Interface written in VBA. I need to have a color scheme for my point shapefile to show differents activities (activity 1=red, activity 2=green)....

I wrote this code in VBA with:

Dim mwColScheme As MapWinGIS.ShapefileColorScheme
Dim mwColBreak As MapWinGIS.ShapefileColorBreak

'Initialize a new ShapefileColorScheme object (make sure to assign the layer handle it goes with)
'mwColScheme = New MapWinGIS.ShapefileColorScheme
Set mwColScheme = New MapWinGIS.ShapefileColorScheme
mwColScheme.LayerHandle = PointLineLayer
mwColScheme.FieldIndex = 5

'Make a color ramp from red to blue for the states with area = 0 to 100000
'mwColBreak = New MapWinGIS.ShapefileColorBreak
Set mwColBreak = New MapWinGIS.ShapefileColorBreak
mwColBreak.Caption = "Bank"
mwColBreak.StartValue = "1"
mwColBreak.EndValue = "1"
mwColBreak.StartColor = RGB(255, 170, 42)
mwColBreak.EndColor = RGB(255, 170, 42)
mwColScheme.Add (mwColBreak)


But when i run it, i got an "automation error, library not registered" on

mwColScheme.Add (mwColBreak)

The library is correctly registered, every works nicely for generating my shapefiles, displaying them but the code get stuck on that line.

I can not really update MapWinGis from my current version 4.7 to 4.8 since i am afraid my code could be broken and i will have to update all my clients PCs...

If i can not solve this code, is there any other way of having a color class/scheme with MapWinGis in VBA?

Thanks for your help

Sylvain

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: