MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Mappoint in OleContainer problem //Delphi

This is a discussion on Mappoint in OleContainer problem //Delphi within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I just started to play with mappoint 2002 trial & Delphi 7... So with the helph of this site ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-18-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Mappoint in OleContainer problem //Delphi

Hi,

I just started to play with mappoint 2002 trial & Delphi 7...
So with the helph of this site I already get a map in my delphi form and I can zoom and pan....

Here's my code: (OleContainer, map dropped on a form)

procedure TForm1.FormShow(Sender: TObject);
var
vGuid : TGuid;
FMap : _Map;
begin
OleContainer_Map.CreateObject('MapPoint.Map.EU.9', FALSE );
OleContainer_Map.DoVerb(1);
OleContainer_Map.OleObjectInterface.GetUserClassID (vGuid);
FMap := IDispatch(OleContainer_Map.OleObject) as _Map;
Map1.ConnectTo(FMap);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
Map1.ZoomIn;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
Map1.pan(geoEast,0.5);
end;

But when I close the Form I get allways the following message:
Application Error:
Exception EAccesVilation in module OLE32.dll at...

Any idea?? (I'm not familiar with the OleContainer...)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 03-18-2003
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,471
Blog Entries: 1
I'm not a Delphi developer, but there are some samples in the Articles section of this site that might be of use to you.. Also, there's some discussions in the forums. You might employ Google to list it all in one swoop: http://www.google.com/search?q=site:...g%2Ecom+Delphi

Happy Mapping!
Eric
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 03-18-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
I already tried this....

Hope some Delphi coder could helph me...

hanks for your quick reply! :D
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 03-19-2003
Junior Member
White Belt
 
Join Date: Jan 2003
Posts: 8
Try the following in FormClose:

OLECont.Align := alNone;
and free all your Delphi controls (Form, Menu, Toolbar, ...)

Greetings, Jack.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 03-25-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Ok I finally solved this problem by myself :D

Just added this:
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Map1.Disconnect;
end;

And no more Application Error 8)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 04-01-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Hi Eric-

I am a Delphi Developer and use the code similar to you. The difference is that I don't do a connect. Still seems to work well here.

Code:
  OleContainer1.CreateObject('MapPoint.Map.NA.9',False);
  OleContainer1.DoVerb(1);
  OleContainer1.OleObjectInterface.GetUserClassID(vGuid);
  mpMap := IDispatch(OleContainer1.OleObject) as _Map;
Ray[/code]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 01-08-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Hi,

I am doing the same thing, but I need to disable the toolbar and the directions pane. I just want to display the map only.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
mappoint, olecontainer, or or delphi, problem


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
MapPoint in OleContainer problem //BCB tomek_tomek MapPoint 2006/2009 Discussion 3 08-16-2005 03:54 PM
Borland C++ Builder : Using Mappoint over olecontainer Anonymous MapPoint 2006/2009 Discussion 2 02-14-2005 05:04 AM
OleVariant Problem with Delphi 6 top204 MapPoint 2006/2009 Discussion 3 04-29-2004 05:51 AM
Delphi OleContainer Resize Problem. Sheridan MapPoint 2006/2009 Discussion 5 12-19-2003 06:50 AM
Delphi OleContainer problems pafreshney MapPoint 2006/2009 Discussion 6 09-15-2003 02:50 PM


All times are GMT -5. The time now is 10:09 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54