Hi Mauro,

I wrote an app that used Mappoint some years ago, so I'm a little vague 
on details, but with that disclaimer my suggestions.

Firstly, don't use an OLE container.  Instead, import the Mappoint type 
library, this gives you nice Delphi native wrappers for the objects and 
types defined/provided by Mappoint, it's much easier and friendlier to 
use than OLE.  (Click "Project"->"Import Type Library" and find the 
"Microsoft Mappoint 13 Object Libary", and import it.  You don't have to 
install it directly, just create the unit if you like, then use it in 
your app.)

Secondly, maybe further wrap up Mappoint to isolate what you want from 
it.  As example, I posted a little wrapper unit I wrote from that app on 
pastebin (The functions were being called from a multi-threaded context 
hence the critical section to help ensure sanity, I can't remember 
anymore the types of issues I had without that protection, anyway you 
may want to remove that if it's not useful/relevant to you), anyway it 
should give you some ideas of how to use Mappoint while keeping 
everything tidy:  http://pastebin.com/q3tJT6gA

HTH,

Walter


Reply via email to