MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




tip: creating object model of mappoint and SQL command

This is a discussion on tip: creating object model of mappoint and SQL command within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I just had following problem., is solved and wants to share it. In Delphi I needed to update an ...


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

Today's Posts Twitter Feed 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 02-24-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
tip: creating object model of mappoint and SQL command

Hi,

I just had following problem., is solved and wants to share it. In Delphi I needed to update an MDB database using SQL ADO components and right after it create a mappoint instance to check in what street vehicle is.

It does not work It get an error (whitch I did not wrote down) like the caller is busy, operation cannot performed. But there is a very simple workaround. Execute the code outside the code where the SQL

So after the SQL things:
Code:
PostMessage(Handle, WM_LOADMP, 0, 0);
and the custom message handler can thenl load MP without problems with folling code:

Code:
constructor TMapPoint.Create(ErrorProc: TOnError);
var
   Reg: TRegistry;
   FileName: string;
begin
   inherited Create;
   FOnError := ErrorProc;
   try
      FMP := TApplication.Create(nil);
      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  begin
         if Assigned(FOnError) then
            FOnError(Self, E);
      end;
   end;
end;
I hope this will benefit other when they have similar problem. It has cost me a few hour of time until my euro was dropping (Flemish proverb)
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
command, creating, mappoint, model, object, sql, tip


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
What it is the command to export data in excel format ? Elbarto MapPoint 2006/2009 Discussion 1 03-15-2006 04:38 AM
Drawing on mappoint object vidyakulkarni MapPoint 2006/2009 Discussion 4 08-05-2004 09:28 AM
route object to drawing object Anonymous MapPoint 2006/2009 Discussion 1 05-09-2003 10:29 PM
I am looking for GIS software that can model off.... Anonymous MapPoint 2006/2009 Discussion 1 07-04-2002 08:29 AM
What is the "Programming Model" of Mappoint, and h.... Anonymous MapPoint 2006/2009 Discussion 1 08-27-2001 11:56 AM


All times are GMT -5. The time now is 02:25 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Zante Holidays
Enjoy lovely sandy beaches when you take your Zante holidays booked through UlookUbook!



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 55 56 57 58 59