This project is read-only.

Installation MapWinGis.ocx rev 52393 . Error in Delphi

Dec 27, 2014 at 3:01 PM
Edited Dec 27, 2014 at 3: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
Dec 28, 2014 at 11: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.

Dec 29, 2014 at 3:37 PM
Replacing all PSYSINT1 by SYSINT it works!!!.
Dec 29, 2014 at 5: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
Jan 1, 2015 at 11:18 AM
The installer for v4.9.3 has this hotfix and can be downloaded at
Please let us know if you run into more issues, we haven't included Delphi in our tests.


Jan 2, 2015 at 9: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?


procedure X(filename: String);
var shape: IShapeFile;
myHandler: integer;
segm: ILineSegment;
util: TUtils;
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;
//the line color orange appears, but the marker isn't a flag, it's a diamond.

Jan 3, 2015 at 8:45 PM
You should set PointShape rather than PointType:
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).

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