Installation MapWinGis.ocx rev 52393 . Error in Delphi

Dec 27, 2014 at 2:01 PM
Edited Dec 27, 2014 at 2:16 PM
I have installated the mapwingis exe downloaded from here.
When import the activex component, delphi generates the Mapwingis_TLB.pas with the definitions, classes and methods, but raises a compilation error (E2008 Incompatible types) at:
property Owner[var t: SYSINT; var d: SYSINT; var s: SYSINT; var l: SYSINT]: PSYSINT1 write Set_Owner; on IGridHeader = interface(IDispatch), same error in:
property Owner[var t: SYSINT; var d: SYSINT; var s: SYSINT; var l: SYSINT]: PSYSINT1 write Set_Owner; of TGridHeader = class(TOleServer).
How can solve it?.

Delphi RAD Studio XE3, Windows XP SP3
Developer
Dec 28, 2014 at 10:47 AM
I haven't got Delphi myself to check it. But I checked the source. The property is defined like this in idl:
[propput, id(14), helpstring("property Owner")] HRESULT Owner([in] int * t, [in] int * d, [in] int * s, [in] int * l, [in] int * f)
So I guess the proper type for all four parameters in pas file should be PSYSINT1 as they are pointers (fifth parameter is treated as the property value and the type is set as PSYSINT1 for it).

Also in fact this property can be safely removed from API as it is for the inner use only. I'll remove it on the next commit, it simply haven't drawn my attention before.

I'm not sure as to what version of MapWinGIS you are using, revision 52393 seems to be something quite old (the first commit listed on this site is 55434). We've just released v4.9.3 which is the recommended one to use. If your TLB problem can't be solved by manual editing we can arrange a hot fix for it by removing the property from API.

Regards,
Sergei
Dec 29, 2014 at 2:37 PM
Replacing all PSYSINT1 by SYSINT it works!!!.
Developer
Dec 29, 2014 at 4:57 PM
I removed the property from API, so there should be no problem in version 4.9.3.
Marked as answer by pmeems on 1/1/2015 at 3:16 AM
Coordinator
Jan 1, 2015 at 10:18 AM
The installer for v4.9.3 has this hotfix and can be downloaded at https://mapwingis.codeplex.com/releases/view/541892
Please let us know if you run into more issues, we haven't included Delphi in our tests.

Thanks,

Paul
Jan 2, 2015 at 8:50 PM
Thanks for the link.
I just downloaded that version.
Some problems between windows versions (Delphi XE3).

The _DMap method AddLayerFromFilename hangs in Windows xp, but works in Windows 7.
The marker always is a diamond... how to change?

Ex.

procedure X(filename: String);
var shape: IShapeFile;
myHandler: integer;
segm: ILineSegment;
util: TUtils;
begin
myMap.RemoveAllLayers;
myHandler := MyMap.AddLayerFromFilename(filename, fosAutodetect, True); //hangs in Windows XP
shape := MyMap.ShapeFile[myHandle];
chape.DefaultDrawingOptions.PointType := ptShapeFlag;
shape.DefaultDrawingOptions.FillColor := clRed;
shape.CollisionMode := AllowCollisions;
shape.DefaultDrawingOptions.LinePattern := TLinePattern.Create(Self).DefaultInterface;
segm := shape.DefaultDrawingOptions.LinePattern.AddMarker(dpsFlag);
// segm := chape.DefaultDrawingOptions.LinePattern.InsertMarker(0, dpsFlag);
util := TUtils.Create(Self);
segm.Color := util.ColorByName(Orange);
segm.MarkerSize := 16;
segm.MarkerInterval := 32;
MyMap.Redraw;
//the line color orange appears, but the marker isn't a flag, it's a diamond.
MyMap.ZoomToLayer(myHandler);
end;



Developer
Jan 3, 2015 at 7:45 PM
You should set PointShape rather than PointType: http://www.mapwindow.org/documentation/mapwingis4.9/class_shape_drawing_options.html
Also ShapeDrawingOptions.SetDefaultPointSymbol can be used as a shortcut, it sets a few necessary properties in a single call.

Regarding Map.AddLayerFromFilename, both Paul and I tested the demo app on XP virtual machine before the release and it worked. It uses this same method for opening files. So I would suggest: 1) check, at least SP2 should be installed for Win XP; 2) Try to open other files, to narrow the problems; 3) Try to open the files with demo app (can be found in mapwindowlite folder of installer). 4) try to open the same file in a regular way (if it is shapefile - Shapefile class, for other vector formats - OgrLayer).

Regards,
Sergei
Jan 6, 2015 at 5:43 PM
Hi Serguei.
As answer to this mail
Adj. message in word.
Can you help me?

Regards.