Hi
What is the solution for loading mappoint 2k6 into an olecontainer in Delphi7. Although it is possible to right click and open mappoint, however, on save or after edit if one tries to close mappoint generates error
"Microsoft MapPoint has encountered a problem and needs to close. etc"
I have tried loading the mappoint in code as shown bellow with no success.
Any suggestions are much appreciated.Code:unit mapPoint; interface uses Controls, Classes, OleCtnrs, MapPoint_TLB; type TMP = class private FMap: _Map; OleContainer: TOleContainer; public constructor Create(AOwner: TComponent; ParentControl: TWinControl); destructor Destroy; override; property Map: _Map read FMap; end; implementation { TMP } constructor TMP.Create(AOwner: TComponent; ParentControl: TWinControl); var Guid: TGuid; begin OleContainer := TOleContainer.create(nil); OleContainer.Parent := ParentControl; OleContainer.Align := alClient; OleContainer.CreateObject('MapPoint.Map.EU.13', False); OleContainer.DoVerb(1); OleContainer.OleObjectInterface.GetUserClassID(Guid); FMap:= IDispatch(OleContainer.OleObject) as _Map; FMap.Application.Units := geoMiles; end; destructor TMP.Destroy; begin OleContainer.DestroyObject; OleContainer.Free; inherited; end; end.
Cheers
M.M.