Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on Help: convert VB code to Delphi! within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Here is the VB code: Dim objPin As MapPoint.Pushpin Set objPin = MPMap.ActiveMap.Selection Here is my delphi code: var objpin ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Help: convert VB code to Delphi! Dim objPin As MapPoint.Pushpin Set objPin = MPMap.ActiveMap.Selection Here is my delphi code: var objpin begin objpin:=map.activemap.selection [Erreur] Unit1.pas(734): Types incompatibles : 'IDispatch' et 'Pushpin' Regards, SD |
| |||
|
Code compile, but objpin method or property don't work. I want to use this code to get Pushpin user click. Here's the complete VB code: Dim objPin As MapPoint.Pushpin ' Check if the user double-clicked on a pushpin If Not MPMap.ActiveMap.Selection Is Nothing Then If TypeOf MPMap.ActiveMap.Selection Is MapPoint.Pushpin Then Set objPin = MPMap.ActiveMap.Selection ' Do whatever with the pushpin... ' We've handled this double-click Cancel = True End If End If End Sub |
| |||
| re: Help: convert VB code to Delphi!
Seb, You may want to make sure that the Map.Selection reference ( to the object the user cliked on ) is actually a PushPin. It might be of some other type, like Location for instance. ///// suggestion var ppClickedPushPin:PushPin; ... if Map.ActiveMap.Selection<>nil then Map.ActiveMap.Selection.QueryInterface(IID_Pushpin , ppClickedPushPin); if ppClickedPushPin<>nil then begin // use ppClickedPushPin here end; ///// /jean-phi |
![]() |
| Tags |
| code, convert, delphi |
| ||||
| Posted By | For | Type | Date | |
| MetaGer, Suche nach: typeof delphi | This thread | Refback | 07-02-2008 03:54 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Convert Lat Lon to X Y | Dazzer | MapPoint 2006/2009 Discussion | 9 | 04-27-2006 10:09 AM |
| Convert .ptm to .jpg | dkirk | MapPoint 2006/2009 Discussion | 6 | 03-03-2005 06:10 AM |
| Convert to Lat/Long | wallacech | MapPoint 2006/2009 Discussion | 1 | 02-26-2004 12:37 PM |
| Convert to Add-In | David Kachuck | MapPoint 2006/2009 Discussion | 0 | 07-06-2003 03:41 PM |
| Problems with Dutch ZIP codes (bug?) (Delphi code provided) | schuchhardp | MapPoint 2006/2009 Discussion | 2 | 11-28-2002 03:37 AM |
Ibiza Holiday
Visit the party capital of Europe with an Ibiza holiday! Check out the deals online on UlookUbook...