MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




No visual MapPoint

This is a discussion on No visual MapPoint within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi. I'm searching a way to create an object with mappoint for a service. But no visible object. without components ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-04-2006
Junior Member
White Belt
 
Join Date: Sep 2006
Posts: 8
No visual MapPoint

Hi.

I'm searching a way to create an object with mappoint for a service. But no visible object. without components like panels, forms, or whatever thing like those. I need it for delphi 7. In this moment i'm testing with a visual form, and with an OleContainer i can create mappoint on a Panel (The container), but it isn't i need.

somebody know how?

thanks!
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 09-04-2006
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,055
Hi,

This little Delphi class opens mappoint in background (invisible). It try to open version 2004 Europe first, if not it checks for 2002 version. You eventally have to change the registry search for version 2006 and of course for the US versions also if nececary.

Code:
unit uMP;

interface

uses
  Windows, SysUtils, Classes, MapPoint_TLB, Registry, Math;

type
  TOnError = procedure(Sender: TObject; E: Exception) of object;

  TMapPoint = class
  private
    FMP: _Application;
    FOnError: TOnError;
  public
    constructor Create(ErrorProc: TOnError);
    destructor Destroy; override;
  end;

implementation

{ TMapPoint }

constructor TMapPoint.Create(ErrorProc: TOnError);
var
   Reg: TRegistry;
   FileName: string;
begin
   inherited Create;
   FOnError := ErrorProc;
   try
      FMP := CoApplication.Create;
      Reg := TRegistry.Create;
      try
         Reg.RootKey := HKEY_CLASSES_ROOT;
         if not Reg.OpenKey('.ptm\MapPoint.Map.EU.11\ShellNew', False) then
            if not Reg.OpenKey('.ptm\MapPoint.Map.EU.9\ShellNew', False) then
               Exit;
         FileName := Reg.ReadString('FileName');
         FMP.OpenMap(FileName, False);
      finally
         Reg.Free;
      end;
   except
      on E: Exception do
         if Assigned(FOnError) then
            FOnError(Self, E);
   end;
end;

destructor TMapPoint.Destroy;
begin
   FMP.ActiveMap.Saved := True;
   FMP.Quit;
   inherited;
end;
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 09-04-2006
Junior Member
White Belt
 
Join Date: Sep 2006
Posts: 8
Thumbs up Thanks!

Great!.
Very easy.

Thanks!
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


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, visual c++ vs visual basic Anonymous MapPoint 2006/2009 Discussion 6 03-30-2004 09:17 PM
Visual Basic. NET and MapPoint Anonymous MapPoint 2006/2009 Discussion 1 07-30-2003 02:49 PM
Visual C++.net and MapPoint evschu MapPoint 2006/2009 Discussion 1 07-07-2003 04:04 PM
Visual basic or visual c++ in mappoint misterb83 MapPoint 2006/2009 Discussion 1 02-14-2003 08:31 AM
I am using Mappoint with Visual C++ via automation.... Anonymous MapPoint 2006/2009 Discussion 2 07-08-2002 01:07 AM


All times are GMT -5. The time now is 04:10 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

Cheap flights to Rhodes
For cheap flights to Rhodes make Holiday Hypermarket your final destination. Holiday Hypermarket help you to have a fantastic affordable holiday.

Flights to Spain
Find cheap flights to Spain on Travel Counsellors. A personal Travel Counsellor can help you plan flights and find accommodation in Spain.

Cape Town Flight
Book a Cape Town Flight for great value when you book through dealchecker.co.uk. It doesn't take long to find the latest great deals for you.

Holidays in Dubai
Holidays in Dubai are an eclectic mix of the ancient and the modern. Discover an oasis of luxury amid the Arabian desert. Book here now!

Portugal
As well as providing some great weather Portugal has much to offer culturally. There are numerous museums, monuments and places of historical interest to explore. Despite the rich history there is a buzzing nightlife and great shopping too.

Compare flight prices
Travel.co.uk makes it easy for you to compare flight prices from hundreds of UK based travel companies.

Portugal Holidays
We specialise in Portugal holidays. Visit our On The Beach website for more information.


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